For the life of me I can't figure out how to do this. I thought I could use memset()
but I'm getting a segmentation fault.
char **a;
token = strtok( NULL, " " );
if( token != NULL )
strcpy( token, strtok( token, "\n" )); // get rid of '\n' at end if it exists
else{
// I want to reset all the values in a to null
return;
}
I thought I could even just do a while loop like while(a[i] != 0 )
set each element to 0, but even then I'm getting a segmentation fault. This should be easy right? What am I doing wrong?