を使用して文字列に追加する前に、明示的にキャストnumber 0する必要があるのはなぜですか?charstring::operator+
using namespace std;
int main()
{
string s = "";
s += 65; // no compile error
s += (char)0; // requires explicit cast
//s += 0; // compile error
return 0;
}
明確にするために更新:私の目標は、既存のバイト配列に1バイト(ゼロを含む任意の値を含む)を追加することでした。