Hey...
I am having a related problem - perhaps someone could help. I'm sure it's really easy.
I'm using:
which doesn't seem to work - all I get is:Code:char *sp_filename = "C:\\Program Files\\Dev-Cpp\\Examples\\example.out"; printf("Attempting to open %c\n",*sp_filename); fp = fopen(sp_filename,"r"); if(fp == NULL) { perror("Cannot open file"); exit(EXIT_FAILURE); }
How do I make it take the whole string, and not just the first letter? I've tried various things like setting sp_filename[BUFSIZ] etc.Attempting to open C
Cannot open file: No such file or directory
What am I doing wrong?
Thanks!



LinkBack URL
About LinkBacks



Though it still didn't want to open the file, due to what I expect was the space in Program Files (since putting the file somewhere else works fine).