Hi all

I am in the initial stages of writing a program to perform mathematical tasks from digits placed in a file, namley notepad. The program keeps returning "No such directory" when I enter a pre prepared file name and after several hours of going round in circles I am getting nowhere. The notepad file and the program are in the same folder (If this helps) and entering either just the file name or even the whole location string just returns the above error. Probably missing something really silly as I am quite new to this, does anyone know why I cant locate the file.

Thanks

Code:
#include<stdio.h>
#include<stdlib.h>
main(void)
{
char ch, filename[25];
FILE *fp;
printf("Enter the name of file you wish to see");
gets(filename);

fp = fopen(filename,"r");
if(fp==NULL)
{
 perror("Error.\n");
 exit(EXIT_FAILURE);
 }
 printf("The contents of %s file are :-\n\n", filename);
 
 while((ch=fgetc(fp) )!=EOF)
 printf("%c",ch);
 fclose(fp);
return 0;

}