Files...creating if one doesn't exist. - 03/02/04 10:08 PM
Hey guys. What I'm trying to do is to a file based on the username. ie:
fstream saveout(filename);
where filename is the username + .txt0
0 being the end marker of a character array.
It's a character array so adding .txt isn't hard and if the file already exists it will write to that file;
I can't seem to find a way to create a file of filename name if(!saveout); I've checked a couple sites and found that this "can't" be done...ha!
It's prety sad when you start using; instead of . :p I just caught myself on the last sentence. Any ideas would be great. Sorry for the technical indifficulty.
fstream saveout(filename);
where filename is the username + .txt0
0 being the end marker of a character array.
It's a character array so adding .txt isn't hard and if the file already exists it will write to that file;
I can't seem to find a way to create a file of filename name if(!saveout); I've checked a couple sites and found that this "can't" be done...ha!
It's prety sad when you start using; instead of . :p I just caught myself on the last sentence. Any ideas would be great. Sorry for the technical indifficulty.