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
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
Last edited by jobolikescake; 10-25-2002 at 12:05 PM.
i tried that but when i go to load that same file it wont load it
Hooked On Phonics Didn't Work For Me!
You should be able to use strcat to add the file extension.
i dont know how to use that
Hooked On Phonics Didn't Work For Me!
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.
Hooked On Phonics Didn't Work For Me!
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
Hooked On Phonics Didn't Work For Me!
you could also use getline() but don't forget to #include<string> class.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
"Be formless, shapeless, like water... You put water into a cup, it becomes the cup, you put water into a bottle, it becomes the bottle, you put it in a teapot, it becomes the teapot... Now water can flow, or it can crash, be water my friend."
-Bruce Lee