this is what i have now:
Code:
#include <stdio.h>
int main(void)
{
char filename[25];
char wordsearch[50] [50];
int width, height;
FILE *f;
{ /* Code for opening the file */
printf("Please specify input file\n");
scanf("%s", filename);
f = fopen(filename, "r");
while (f==NULL)
{
printf("Couldn't open input file, please change the file name \n");
scanf("%s", filename);
f = fopen(filename, "r");
}
} /* end of code for opening file */
{
fscanf(f,"%d %d",width, height);
printf("The height of the grid is... ", height);
printf("The width of the grid is... ", width);
}
}
however when i run that programme it seems to crash on the scanf part, any reason why?? is there something im missing?