I know i can get input from a .dat file like thisbut what i was wondering is if there is another way to get the same effect without using scanf?Code:do // get maze file name { printf("\nPlease enter a maze file name, if finished enter \"Done\"\n"); scanf("%s",dataName); if (strcmp(dataName,"Done")==0 | strcmp(dataName,"done")==0) { printf("\nThank you for running the maze.\n\n"); // accept either "Done" or "done" return 0; // and exit the program } else { if (!strstr(dataName,".dat")) // validate the maze file name { if (strstr(dataName,".txt")) { i = strlen(dataName)-4; dataName[i]='\0'; } strcat(dataName,".dat"); } if ((mazeData=fopen(dataName,"r"))==NULL) printf("\n%s does not exist.\n",dataName); else break; // if valid file, exit get name loop } } while (strcmp(dataName,"done")!=0);