Im using strtok and a little confused.
I have an array containing many rows, and I want to tokenize the rows in a temporary array. When I execute strtok, it stores the first token in a temporary array, but also changed the original value of the array. So I was very confused.
char cmdTok[10] , *cmd = cmdTok; printf("command[0] = %s\n", commands[0]); cmd = strtok(commands[0], " \n\0"); printf("command[0] after strtok = %s\n", commands[0]);
Exit
command[0] =
How to save the original values in the team?
source share