Hey...

I am having a related problem - perhaps someone could help. I'm sure it's really easy.

I'm using:

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);
    }
which doesn't seem to work - all I get is:

Attempting to open C
Cannot open file: No such file or directory
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.

What am I doing wrong?

Thanks!