Hello.
Can some one help me, using strtok and some checks.
this is the pure example of strtok. I already tried so many times but i so noob i can figure it out.Code:int num_args() { int numero=0,size=0 char op[20]="p 1 1",char op1[20]="p 10 20"; char *pch; size=strlen(op); printf("SIZE->%d\n",size); pch = strtok (op," "); while (pch != NULL) { numero++; pch = strtok (NULL, " "); } return numero; }
I need so check is first token is always letters (already try using isalpha) and the other two tokens are only digits (isdigit).
can some one make some lights over my head
This is an "small game" and i need to check with piece want to play (letter) and corrdinates x and y.



LinkBack URL
About LinkBacks



