欧美大屁股bbbbxxxx,狼人大香伊蕉国产www亚洲,男ji大巴进入女人的视频小说,男人把ji大巴放进女人免费视频,免费情侣作爱视频

歡迎來到入門教程網(wǎng)!

C語言

當(dāng)前位置:主頁 > 軟件編程 > C語言 >

求32位機(jī)器上unsigned int的最大值及int的最大值的解決方法

來源:本站原創(chuàng)|時間:2020-01-10|欄目:C語言|點擊: 次

復(fù)制代碼 代碼如下:

#include <stdio.h>
int main(int argc, char *argv[])
{
 unsigned int max_int = 0-1;
 printf("The max value of unsigned int on 32 machine: %u/n", max_int);
}

復(fù)制代碼 代碼如下:

#include <stdio.h>
int main(int argc, char *argv[])
{
 unsigned int max_int = 0-1;
 printf("The max value of unsigned int on 32 machine: %u/n", max_int);
}

gcc編譯后:
int_sizeof1.c: 在函數(shù)‘main'中:
int_sizeof1.c:5: 警告:整數(shù)溢出
運行后:
The max value of int on 32 machine: 4294967295
 
VC6.0和java編譯后,無錯誤。
運行后:
The max value of int on 32 machine: 4294967295
復(fù)制代碼 代碼如下:

#include <stdio.h>
int main(int argc, char *argv[])
{
 int max_int = (1<<31)-1;
 printf("The max value of int on 32 machine: %d/n", max_int);
}

將其int寫成有符號型的程序如下:
復(fù)制代碼 代碼如下:

#include <stdio.h>
int main(int argc, char *argv[])
{
 int max_int = (1<<31)-1;
 printf("The max value of int on 32 machine: %d/n", max_int);
}

gcc編譯后:
int_sizeof1.c: 在函數(shù)‘main'中:
int_sizeof1.c:5: 警告:整數(shù)溢出
運行后:
The max value of int on 32 machine: 2147483647
VC6.0和java編譯后,無錯誤。
運行后:
The max value of int on 32 machine: 2147483647
因為int的最高位是符號位。

網(wǎng)頁制作CMS教程網(wǎng)絡(luò)編程軟件編程腳本語言數(shù)據(jù)庫服務(wù)器

如果侵犯了您的權(quán)利,請與我們聯(lián)系,我們將在24小時內(nèi)進(jìn)行處理、任何非本站因素導(dǎo)致的法律后果,本站均不負(fù)任何責(zé)任。

聯(lián)系QQ:835971066 | 郵箱:835971066#qq.com(#換成@)

Copyright © 2002-2020 腳本教程網(wǎng) 版權(quán)所有