[ create a new paste ] login | about

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

C, pasted on May 17:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <stdio.h>
#include <string.h> 

void main(void)
{
    char str[] = "60x40";		
    char *token;
    char *rest = str;
    char *save;

    while((token = strtok_r(rest, "x", &save)))
    {
        rest = NULL;
        printf("token:%s\n", token);
    }
}


Output:
1
2
token:60
token:40


Create a new paste based on this one


Comments: