Having some trouble with an assignment. Here is the prompt.
Write a program that reads the telephone.dat file and displays its contents on the console. The program should allow the user to add new entries to the file.
I have saved the file into a resource file within visual studio and I am trying to run the code to where the file will be shown when I run the program. I know that the program is running and the file is there because if i misspell the filename it will give me the error message. I don't know how to make the contents of the file display. Here is what I have so far. Any and all tips are welcome.
I thought so as well, my book as it shown that it should've given me the cout I needed. Since it didn't work I found a different code and tried this and I'm still not getting anything whenever I run the code. Here is the new code I tried. I'm at a loss.
Both methods aren't giving me anything. Although I know that the code is opening the file, because if I change the name of the file to lets says "telephne.dat", the error message will display. Other than that, nothing prints out.
Yes.
I thought maybe I didn't have the file in the right place, but it is.
Data in the file is
Tony Gaddis 1234567890
Barack Obama 2024561111
James Bond 0070070007