unsigned int a=2;int b = -3;
来源:百度知道 编辑:UC知道 时间:2024/05/15 12:07:26
结果是多少
因为输出格式问题。
printf("%d",c); -- 按有符号整数格式输出。-1
printf("%u",c); -- 按无符号整数格式输出 4294967295
int -- VC++ 编译器处理为 long int, (32 位).
TC 编译器处理为 short int, (16 位).
printf("%u",c); 输出结果不同。
你如果这样写的话:unsigned int a=2;int b = -3;
这说明你定义了一个无符号整形a=2,又定义了个整形b=3.最终结果是:a=2,b=3.
我想你是想问这样定义吧:
unsigned int a=2,int b = -3;
这样你定义了两个无符整形:a和b
最终结果是:a=2,b=4294967293;
b是溢出的结果。
unsigned a=2;
int b=-3;
两个数没什么问题,还是取原来的值。
如果unsigned int b=-3;
当b以%u 输出时是65533
unsigned int a=2;int b = -3;
定义unsigned int a;输入-1程序怎么处理
unsigned 与int哪个好?
fun1(int a,int b)
void a(int a,int b=0)的含义?
struct st{ int a;int b[2];}a;
srand((int)getpid());srand((unsigned) time(&t));
java问题 int a[ ]=new int[5]是什么意思
int a,public int a,private int a,怎么区别?
编写具有如下原型的函数:int f(unsigned long x, int n, int& Lxn);