Just save the file on C:\Temp and then replace "telephone.dat" to "C:\\Temp\\telephone.dat". It will open the file. If it fails, the else statement is executed.
Once you get the file to display on the console, you can modiy the main function as follows:
int main(const int argc, const char * argv[])
you can pass in the full file path to your application from the command line. You check if argc is greater or equal to 2. If it is, then argv[0] is your full path of your app and argv[1] is your file you want to read.
For visual studio, you can add it under Configuration Properties -> Debugging -> Command Arguments.
Well I'm not having any trouble with the file opening. Whenever I change the name of the file it will run my error..I'm just having a problem with getting it to display when the program is run.