how can i give a file i save a name that the user picks
ex..
[CODE]
output.open("text.txt"); \\ heres where i want to make it so that...
output << one; \\ it names the txt file based on the users
.....and so on \\ imputed name.
thx for the help :)
Printable View
how can i give a file i save a name that the user picks
ex..
[CODE]
output.open("text.txt"); \\ heres where i want to make it so that...
output << one; \\ it names the txt file based on the users
.....and so on \\ imputed name.
thx for the help :)
i tried that but when i go to load that same file it wont load it
You should be able to use strcat to add the file extension.
i dont know how to use that
how about this ill post the code for the program, its not done yet but ill point out the places where it is messing up
p.s. dont comment about the use of goto's, i like them and it makes me program easier even though people say you shouldnt use them.
Holy hole in a donut batman! Talk about really superfluous use of goto!
Each one of those gotos could be made into functions, and that way you wouldn't be mocked for using such a terrible programming practice.
i know i could make them into functions with something called void and some other stuff but i asked about it one time and everyone acted like i didnt know what i was talking about. so i still dont know how to do it.....poor poor me :( :( :( :( :( :confused: :confused:
you could also use getline() but don't forget to #include<string> class.Quote:
how can i give a file i save a name that the user picks
something like this perhaps...
[code]
#include<iostream>
#include<string>> //for strings, getline()
int main()
{
cout<<"Enter the string being sought:";
string searchString;
getline(cin,searchString);
etc..
}
I hope this helped.
cj
:D