Reputation: 95
Yeah so ive tried lots of stuff but the output keeps coming out all messed up. Heres a picture showing whats going on. As you see the letter variable gets all weird.
Upvotes: 0
Views: 87
Reputation: 4293
The problem is that "letter: " + letter"
doesn't do what you think it does, it adds the integral value of letter to the const char*
string literal "letter"
. Easiest fix is string("letter: ") + letter
.
Upvotes: 3