[ create a new paste ] login | about

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

C, pasted on Apr 24:
1
2
3
4
5
6
7
8
9
10
void main()
{
    char* str = ":12 sdfsdf :45:18";
    char* p = str;
    while (*p)
    {
        if (*p++ == ':')
            printf("%d\n", atoi(p));
    }
}


Output:
1
2
3
12
45
18


Create a new paste based on this one


Comments: