Geespot
Sep 1st, 2002, 10:22 AM
Hi
How can i read an entire file into a variable?
pfile2 = fopen("filename.txt", "r");
long counter=0;
char sFileCheck[25000000];
while ( (mychar = fgetc(pfile2) ) != EOF )
{
sFileCheck[counter] = mychar;
counter++;
}
fclose(pfile2);
thats what i used but it crashes on the char sFileCheck[25000000)
and i cant load the file up bit by bit because i need to do something with the whole file
Thanks
How can i read an entire file into a variable?
pfile2 = fopen("filename.txt", "r");
long counter=0;
char sFileCheck[25000000];
while ( (mychar = fgetc(pfile2) ) != EOF )
{
sFileCheck[counter] = mychar;
counter++;
}
fclose(pfile2);
thats what i used but it crashes on the char sFileCheck[25000000)
and i cant load the file up bit by bit because i need to do something with the whole file
Thanks