I have the following code in C:
int i = 0; char delims[] = " \n"; char *result = NULL; char * results[10]; result = strtok( cmdStr, delims ); while( result != NULL ) { results[i] = result; i++; result = strtok(NULL, " \n"); } if(!results[1]) { printf("Please insert the second parameter...\n"); } else { ... }
It always fulfills the else clause, even if results[1] empty.
I tried with results[1] == NULL , but did not succeed.
How to check if empty or not?
user1893187
source share