wrote:
> Yes, I know that C++ has a string object just as Java does. However,
> I'm required to use a char array, and not the string function. String
> was created by a C++ user, not built directly into the language.
>
That's nonsense, std::string is part of the C++ standard library. It is
there for a reason!
> Next, I have the parameters because I do not want to alter
> originalString. Once I begin to tokenize it, the originalString would
> not have it's original value upon completion. I need it to have it's
> originalValue at the end of every function. I wanted to pass it as a
> parameter so that I could simply work on the new copy of it (pass-by-
> value) and not the original.
>
But originalString is a data member of the class, so you don't have to
pass it to member functions, they can just use it.
> Finally, I did try to create a method to access originalString. It
> didn't work. It was the getString() function. I had originally tried
>
> char[] getString() {
> return originalString;
> }
>
Why not const char* getString() { return originalString; } ?
> However, it wasn't working either. getString() is commented out in
> the program and never actually used as it gave errors.
>
Define not working.
--
Ian Collins.