(for reference i am in c++, windows, borland 3 compiler)hey guys here is what i want to do, i am trying to save a file using <fstream> but want the player to pick a name to save the file as, so to do that i have to modify the string they input to say the path and the file extension in it (thus able to just ofstream.open(savename) type of a thing). as i understood it before the charecter strings are stored as arrays so i would use two strings and basically combine them using one spot at a time. but when i tried this it didn't work, any ideas?
evilsilver
0
Junior Poster in Training
Recommended Answers
Jump to PostWhen working with C-style strings, the first thing you need to remember is to have enough memory. If you're going to tack a string onto another string, make sure that the destination string has enough memory to hold both strings plus one null character.
You can concatenate strings with …
Jump to PostIf you can get hold of a string class that handles all of this low level stuff behind the scenes, you'll be better off
Back in my 'ole highschool days in AP Computer Science class, we used a library called apstring, it's usage is similar to how java handles strings. …
All 6 Replies
Narue
5,707
Bad Cop
Team Colleague
BountyX
7
Posting Whiz in Training
1o0oBhP
4
Posting Pro in Training
Narue
5,707
Bad Cop
Team Colleague
1o0oBhP
4
Posting Pro in Training
Narue
5,707
Bad Cop
Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.