I posted here the other day about an issue I was having a program I have written in that it wouldn't compile. Now I have run into another problem.
Before I begin asking my question though I would like to note that I am asking a question about a program that I am required to write for my college (Seneca College) but that I do not want someone to solve it for me or give me the answer or something along those lines, just to help point me in the right direction or understand exactly what is going wrong.
The problem is that I am trying to copy data from a string sent to my function over into another string, but it's adding a weird triangle on at the end and I have no idea why it's doing this. Here is what I mean. I printed off the character from the string sent and the character from the string the data is being put into afterwards, that is why there are double letters. The word I am copying over is "look".
Here is what I get:
http://img.photobucket.com/albums/v341/overmindrf/what.jpg?t=1276741240
I am compiling two files, one of which includes a file (#include "command.h") that contains the class I am accessing. The other file is provided to us and is the main, and the compiler seems to be telling me that that is where the errors are coming from.
Here is the main he provided us with:
http://pastebin.com/ypeEa9AF
Here is the program I wrote:
http://pastebin.com/nq4PdLFJ
The function that I believe is causing the problem is the very first one.
Here is the class:
http://pastebin.com/3UP2qyup
Any and all help would be greatly appreciated. I'm entirely unsure as to what is causing the problem, because it keeps telling me it's in his program (a2main.cpp. My code is command.cpp and the class is command.h). If any other information is required, please ask.
Thank you in advance.