All pastes #2056585 Raw Edit

Unnamed

public c v1 · immutable
#2056585 ·published 2011-05-11 06:23 UTC
rendered paste body
#include <stdio.h>#include <stdlib.h>#include <string.h>int main(int argc, char *argv[]) {  char buf[256];  char ptr[256];  char *x, *y;  strcpy(buf, "test string 1");  strcpy(ptr, "some,comma,delimited,values");  for (x = strtok(buf, " "); x; x = strtok(NULL, " ")) {    printf("x is [%s]\n", x);    for (y = strtok(ptr, ","); y; y = strtok(NULL, ",")) {      printf("y is [%s]\n", y);    }  }}