Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Naming a Text file in C++

Name: OP !ewz/7gcXdY 2008-05-13 23:46

I am working on a small project, and I need to be able to let the user name there txt file. I have tried many things, none have worked.

Also, I'm not exactly the best C++ programmer, so if you could, please explain your answers with a lot of detail.

But what I want is:

char filename;
cin>>filename;
ifstream inputFile;
inputFile.open(filename, ".txt", ios::in);

Obviously, the last line of code is wrong, but thats what I would like to work. I have tried:

strcat(filename, ".txt");
inputFile.open(filename, ios::in);

And it did not work either.

Name: Anonymous 2008-05-14 8:23

>>8
This guy knows how to win on the Internet.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List