Can't seem to quite get this function to work...(should be easy)
Okay, so I have created a class MyString, and in it, I have a copyTo function. It has a starting position, an ending position, and the string it's supposed to be copied to.
Here's the function call from another class in the program:
Address is the whole string that I'm testing it, and LocalPart.UserName is a Mystring.
Address.CopyTo(0, atPosition, LocalPart.UserName);
and here's the function itself:
Buffer is a member of the MyString class, and the ONLY member, it is a char *
void MyString::CopyTo(int startPosition, int length, MyString &destination)
while( startPosition != length )
destination.Buffer[startPosition] = Buffer[startPosition];
Whenever I try to do this, it comes out with length 71...which has nothing to do with any part of the program...at all.
Doing some random crap, I've gotten it to say 24, which is the size of the string I'm testing it with atm, but nothing to what it's supposed to be. :|