Need help again, working on a program that will take a string inputted by the user and write it to a file in hex form, I have done this but I also want it to be able to read hex from files and output it to ascii this is where I am having problems I began the function:
Code:
int readdata(void)
{
char file_name[40];
char filedata[9000];
int q=0; /*number of characters file has*/
int count; /*EOF flag from file*/
int i=0;
FILE *fp;
gets(file_name);
fp=fopen(file_name, "r");
if(fp==null) {
printf("cannot find file");
exit(8);
}
while(1) {
ch=fgetc(fp);
count++;
if(count==EOF) break;
}
filedata=fscanf(fp, "%[^' ']%*x", struct.memberSTRING);
}
I am stumped (from this point) & am %99.9 certain that is entirely wrong can anyone help?