Original Post
i wanted a simple load routine, wrote this is works but am i just being a lameass and missing an easier way. How do i allocate memory large enough for the file at runtime.
.
[edited by - Null and Void on January 8, 2004 3:11:04 PM]
void ReadWorld()
{
int i = 0;
FILE *input = fopen( "data/world.txt", "r" );
world[i] = getc( input );
while( world[i] != EOF )
{
i++;
world[i] = getc( input );
}
fclose(input);
// int a = i;
}
Thanks for anyhelp. Edit: have some source tags
