Re: Problems with getline
'command' is an array of pointers for which you seem to have neglected to allocate memory. So:
Originally posted by Ion Blade
The array is declared as this...
char *command[MAX_COMMANDS]; //commands
The problem is, when the program gets to the file.getline point, it crashes with an illegal operation i presume to be caused by trying to read something that isn't there. Any help?
and don't forget to delete each 'command' pointer when you're done.
//get the commands
for (i=0; i<MAX_COMMANDS; i++)
command[i]=new char[YOUR_STR_LEN + 1];