私はC++、Linuxの中で働いていますし、私は次のような問題が発生します。C++の構造体のデータメンバー
はstruct testing{
uint8_t a;
uint16_t b;
char c;
int8_t d;
};
testing t;
t.a = 1;
t.b = 6;
t.c = 'c';
t.d = 4;
cout << "Value of t.a >>" << t.a << endl;
cout << "Value of t.b >>" << t.b << endl;
cout << "Value of t.c >>" << t.c << endl;
cout << "Value of t.d >>" << t.d << endl;
私のコンソールに出力されている:
Value of t.a >>
Value of t.b >>6
Value of t.c >>c
Value of t.d >>
それはTAとTDのように思えますint8_tおよびuint8_tタイプでは欠落しています。それはなぜそうですか?
ありがとうございました。
bravo buddy:+ 1 – Chubsdad
...「<< unsigned(ta)<<」と「<< unsigned(tb)<<」 –
...として出力するか、<< static_cast(ta)<<および<< static_cast (tb)<< ...^_^... –
paercebal