|
-
Sep 1st, 2002, 10:22 AM
#1
Thread Starter
Fanatic Member
Read a file into a variable
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|