[ create a new paste ] login | about

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

kinopiko - C, pasted on Nov 13:
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <string.h>
#include <stdio.h>

int main ()
{
   char*    del = ";";
   char * input = strdup ("city=Boston;city=New York;city=Chicago\n");
   char* record = strtok (input, del);
   while (record) {
       printf("Record: %s\n",record);
       record = strtok (NULL, del);
   }
}


Output:
1
2
3
4
Record: city=Boston
Record: city=New York
Record: city=Chicago



Create a new paste based on this one


Comments: