If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Ask user for output file name

I am trying to create a program, where I prompt the user to name the output file name. I need the output file to be a .txt file. I know how to create, open and close an output file. But when I try to implement by asking user for the name, I am stuck. In addition, I am trying to let the user print out an entire sentence, but I can only get the first word. How would I fix this problem?

Another part of the program I am trying to solve is:

If the user chooses to open an existing file, it should show a list of all files that have been created with that program. The user types up the name of the file, and the program displays the contents of the file. Can anyone give me ideas of how I approach this problem.

Re: Ask user for output file name

Re: Ask user for output file name

I put it in a while loop, because I have more parts to program that I haven't started yet. I will be asking the user to open and close other files. So that's why it seems sort of pointless at this moment.