I got this code:
len is an integer, and it's value after trap_Fs_fopenfile, is the size of the file he is opening, so before actually reading the file, i want to create a character array that will be big enough to get the entire file.Code:len = trap_FS_FOpenFile( filename, &f, FS_READ ); if( len <= 0 ) { return va( S_COLOR_RED "file not found: %s\n", filename ); } char filetext[len];
so I'm thinking: char filetext[len];
But I'm getting errors:
error C2065: 'filetext' : undeclared identifier => at a line a bit futher where I pass filetext as a parameter
error C2143: syntax error : missing ';' before 'type' => at the line char filetext[len]; (and no ; is missing for the record)
Anyone know how I can get this to work?