I need to be able to set the size of the array based on the number of bytes in the file.
For example, I want to do this:
fseek (fp, 0, SEEK_END);
size_t file_size = ftell(fp);
rewind(fp);
char buff[file_size];
However, I get a compile-time error saying that the size of the buffer should be constant.
How can i do this?
source
share