#include // split_tester.c : Test program to call splitline function and show results #define LINELEN 2000 #define ROWS 10 #define PARTLEN 40 #define DELIM ';' int split_line(char [], char, char [ROWS][PARTLEN] ); // declare function /* * read in rows and then display the items */ int main() { char b[LINELEN]; // holds input line - to split char table[ROWS][PARTLEN]; // holds the parts int n_parts; // number of parts int i; // loop index while ( fgets( b, LINELEN, stdin ) != NULL ) { n_parts = split_line(b, DELIM, table); printf("number of items is %d\n", n_parts); for ( i = 0; i < n_parts ; i++) { printf(" %d |%s|\n", i, table[i]); } } }