garbage letters in the middle of a word

if I compare two words with a equals sign in the middle of the word i get garbage letters were the equals sign is, for example, if use the word "true-blue" with the equals sign to camper the two variables, the word "ture-blue" reads like this "true� � �blue" how can i get it to so there wont be ant garbage letters in the middle? I have tried using pr[9]='\0'; but i still get the letters in the middle as garbage.
Last edited on
Perhaps you should show your code that we would know what you do, exactly?
I think it happen because you are using the pointers not the right way. It's really important to know how to work with them as they create a lot of errors when used wrong. There are programs that helps with those kind of errors, as checkamrx, but I recommend practicing c++ and in the long term it is going to help you a lot.
Good luck.
Topic archived. No new replies allowed.