Quote:Original post by JTR1080Quote:Original post by Zahlman
C++ provides tools for dealing with this sort of thing in a way that's easy and *works*. In particular, it provides std::string (which also avoids problems with needing a particular buffer length).
I think that is my problem, the constructor for the surface with the overloaded
value of char* handleName, sets that char* to whatever the address in memory
handleName is, which is probably tileBitmap array so when it gets changed to
the new variable it changes the handleSurface. I'm changing the members of Csurfaces to have char intstead of char* to hold the data, the only problem is converting between the two so i have to write some annoying code like
*** Source Snippet Removed ***
hopefully it works
edit: problem solved! :)
No, the problem as was mentioned by Zahlman is that you are using char's and char *'s when you should be using std::string. There really isn't many reasons now adays when you actually want to use a char *. It really is in your best interest to learn how to use std::string. It's way easier to handle and can be converted to a char * if needed to by some archaic api function.
You are basically doing a lot of work to work around a problem that already has a valid answer. Please consider reading up on std::string.