[ create a new paste ] login | about

Link: http://codepad.org/nRxgKJn0    [ raw code | output | fork ]

C, pasted on Oct 11:
1
2
3
4
5
6
7
8
9
10
11
12
13
#include<stdio.h>
#include<string.h>
#define MAX 20
int main(){
	char csv[] = "\"MARY\",\"PATRICIA\",\"LINDA\",\"BARBARA\",\"ELIZABETH\"";
	char *name = "", 
       *parse = csv;
	while(name = strtok(parse, "\",")){
		printf(" %s\n", name);
    parse = NULL;
  }
	return 0;
}


Output:
1
2
3
4
5
 MARY
 PATRICIA
 LINDA
 BARBARA
 ELIZABETH


Create a new paste based on this one


Comments: