Could someone help me with this code. My goal is to create a simple dos program that can read and display the contents of binary help files. I am not looking to create a hex editor or anything like that.
#include <stdio.h> // old c stuff
#define CRTWIDTH 80
#define CRTLENGTH 20
int main(int argc, char *argv)
FILE *inFile = NULL;
unsigned char fileBuffer[CRTWIDTH -1];
if(argc == 1)
// open... test file here fopen(fileName, "rb")
// reading contents... help here is needed
if(loop < sizeof fileBuffer)
fileBuffer[loop++] = (unsigned char)fgetc(inFile);
for(loop = 0; loop <= sizeof fileBuffer; count++)
// this char isn't cutting it
This is returning the binary info but not the way in which a user can read it. any ideas on how to fix this would be greatly appreciated.