首页 > 代码库 > 【ThinkingInC++】8、说明符,探讨数据类型的大小
【ThinkingInC++】8、说明符,探讨数据类型的大小
/** * 功能:说明符,探讨数据类型的大小 * 时间:2014年8月10日11:02:02 * 作者:cutter_point */ #include<iostream> using namespace std; int main() { char c; unsigned char cu; short int is; short iis; unsigned short int isu; unsigned short iisu; int i; unsigned int iu; long int il; long iil; unsigned long int ilu; unsigned long iilu; float f; double d; long double ld; cout <<"\n char= "<<sizeof(c) <<"\n unsigned= "<<sizeof(cu) <<"\n short int= "<<sizeof(is) <<"\n short= "<<sizeof(iis) <<"\n unsigned short int= "<<sizeof(isu) <<"\n unsigned short= "<<sizeof(iisu) <<"\n int= "<<sizeof(i) <<"\n unsigned int= "<<sizeof(iu) <<"\n long int= "<<sizeof(il) <<"\n long= "<<sizeof(iil) <<"\n unsigned long int= "<<sizeof(ilu) <<"\n unsigned long= "<<sizeof(iilu) <<"\n float= "<<sizeof(f) <<"\n double= "<<sizeof(d) <<"\n long double= "<<sizeof(ld) <<endl; return 0; }
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。