如果我们不将int或char放在无符号和有符号变量之后会怎样?
#include<iostream>
using namespace std;
int main()
{
unsigned u = 10; // how is this declaration helpful?
signed s = 12; // is there any use with such declarations without specifying a primitive datatype
cout << u << " " << s << endl; // prints the values of the variables as usual
return 0;
}
答案 0 :(得分:3)
signed
和unsigned
分别隐含表示signed int
和unsiged int
。