heres the piece of code
But it works fine if array is used that is
char trial[] = "((100,1,101),( 11,1,12))";
Can anybody tell me wats the cause of that?
Code:
void main()
{
char *trial = "((100,1,101),(11,1,12))";
char *t1;
int n;
for ( t1 = strtok(trial,",");
t1 != NULL;
t1 = strtok(NULL, ",") )
{ //n = atoi("100");// a = strtok(trial," ");
printf("\n%s",t1);}
//printf("\n%d",n);
getch();
}
char trial[] = "((100,1,101),( 11,1,12))";
Can anybody tell me wats the cause of that?
Comment