I'm trying to pass a filename to another function called first. But I keep getting the error "char *[50] not compatible with char *". The error is in the line "filename = strtok(....)". But I don't know how to fix it.
This is just a section of a function called main:
Code:cmdptr = strtok( cmdline, " " ); //retrieves first word/token in command line if ( strcmp(cmdptr ,firststring) == 0) { //firststring is just a string used to compare numptr = strtok( NULL, " "); //retrieves num num = atoi(numptr); //converts string to int /*ERROR HERE BUT WHY?*/ filename = strtok( NULL, " "); //retrieves filename first( num, filename ); //execute FIRST function }
filename is declared as " char *filename[50]; " as a global.



LinkBack URL
About LinkBacks



