Thanks for the replies. Sorry for the simple mistakes, I'm still learning.
This may be totally off, but I was thinking something like this might work, but if I try to print the string pointed to by input_file, I get nothing. I need load the file into accessible memory locations so I can search through and print out various values at certain locations.
Thanks again for helping.
Code:
printf( "\n Loading %s into memory. . .\n\n", argv[1] );
char buffer[256];
int length = 0;
while( fgets( buffer, sizeof(buffer), in ) != 0 ) {
length += strlen( buffer );
}
char *input_file;
if( (input_file = malloc( length )) != NULL ) {
fread( input_file, 1, 946, in ); //assuming input file is 946 bytes
}
printf( "input_file: %s\n", input_file );