Hi everyone, I'm doing a beginners C++ paper at Uni and I'm stuck. Basically I need to read data from a file and then display it on the screen. So far I've got:
Correct headers will be called.....
int main(){
char filename[30];
FILE *in;
printf("Enter file you wish to open\n");
gets(filename);
in = fopen(filename,"r");
printf("%s", 'in');
if (in == NULL) {
printf("Error could not open %s\n", filename);
exit(1);
}
}
I can't use any other functions than those above. Where am I going wrong?? THanks.