Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ええ、私はたくさんのことを試しましたが、出力はすべて台無しになり続けています。これが何が起こっているのかを示す写真です。ご覧のとおり、文字変数はすべて奇妙になります。
問題は、"letter: " + letter"あなたが思っていることをしないことです。const char*文字列の整数値をリテラルに追加します"letter"。最も簡単な修正はstring("letter: ") + letter.
"letter: " + letter"
const char*
"letter"
string("letter: ") + letter