cout で文字列を出力できない場合のトラブルシューティング
cout を使用して文字列を出力できないのはなぜですか?この問題を詳しく調べて解決策を提供しましょう。
コード スニペット内:
<code class="cpp">string text; text = WordList[i].substr(0, 20); cout <p>次のエラーが発生します:</p> <pre class="brush:php;toolbar:false">Error 2 error C2679: binary '<p>このエラーを解決するには、必要なヘッダーを含める必要があります:</p><pre class="brush:php;toolbar:false"><code class="cpp">#include <string> #include <iostream></iostream></string></code>
修正されたコードは次のとおりです:<code class="cpp">#include <string>
#include <iostream>
string text;
text = WordList[i].substr(0, 20);
cout <p>これで、cout を使用して文字列を正常に出力できるはずです。</p></iostream></string></code>
以上が「cout」を使用して文字列を出力できないのはなぜですか?の詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。