Language Ccpp Cref Examples Strpbrk.c

 
/*
 * field.c
 * 
 * Dave Doolin 12 May, 1995
 * 
 * Turns miscellaneous field separators into just a space separating tokens for
 * easy parsing by SSCANF. Eventually, the character separators and
 * replacement character will be passed in as strings.
 * 
 */
#include <stdio.h>
#include <string.h>
#include <strings.h>
#define LINE_BUF 100
void find_comment(char *);
main()
{
 char line[LINE_BUF];
 char *sep;
 int var1, var2;
 while (fgets(line, LINE_BUF, stdin))
 {
	/*
	 * Check this out: Since SEP is a pointer to type char, when line is
	 * assigned to sep, really the first address is assigned to sep. LINE
	 * is the address of the start of the string. In contrast, LINE[0]
	 * is the first character of the string.
	 */
 sep = line;
 while (sep != 0)
 {
 sep = strpbrk(line, ";.&:,");
 if (sep != 0)
 *sep = ' ';
 }
 fputs(line, stdout);
 }
 return 0;
}

file: /Techref/language/ccpp/cref/EXAMPLES/strpbrk.c, 0KB, , updated: 1997年4月21日 09:52, local time: 2025年9月16日 04:30,
40.74.122.252:LOG IN

©2025 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF="http://techref.massmind.org/techref/language/ccpp/cref/EXAMPLES/strpbrk.c"> language ccpp cref EXAMPLES strpbrk</A>

Did you find what you needed?

Welcome to massmind.org!

Welcome to techref.massmind.org!

.

AltStyle によって変換されたページ (->オリジナル) /