[ create a new paste ] login | about

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

C, pasted on Feb 11:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
void main()
{
char string[]=  "abc/qwe/jkh";
char *array[10];
int i=0;

array[i] = strtok(string,"/");

while(array[i]!=/0)
{
   array[++i] = strtok('/0',"/");
}
 for (i = 0; i < 1; ++i) 
        printf("%s\n", array[i]);
}


Output:
1
2
3
4
5
6
In function 'main':
Line 7: warning: assignment makes pointer from integer without a cast
Line 9: error: expected expression before '/' token
Line 23: warning: multi-character character constant
Line 11: warning: assignment makes pointer from integer without a cast
Line 2: warning: return type of 'main' is not 'int'


Create a new paste based on this one


Comments: