Building own String class
-
(There's probably a thread like this one every day so... sorry!) I'm working on a project in which I want to rely only on my own code so therefore I have to go through the pains of writing my own String class. I am a C++ programmer at beginner/intermediate level so there might be some very flagrant errors in there. This is what I have so far: Declaration Definition Any suggestions would be appreciated!
-
(There's probably a thread like this one every day so... sorry!) I'm working on a project in which I want to rely only on my own code so therefore I have to go through the pains of writing my own String class. I am a C++ programmer at beginner/intermediate level so there might be some very flagrant errors in there. This is what I have so far: Declaration Definition Any suggestions would be appreciated!
Whilst I haven't looked at your code, I would suggest seriously considering whether it is worth writing your own string class, given that there are a million implementations of it already both in the standard C++ libraries and on the 'net. Strings are funny because they're succeptible to buffer overflow errors all over the place so if you do implement your own string class, this is something you will have to be very careful of. Alternatively, the std::string class from the STl has this all done already. Just a suggestion... -- Andrew.