C各种类型变量所占字节
来源:互联网 发布:手机淘宝与支付宝绑定 编辑:程序博客网 时间:2024/05/15 10:43
首先说我的电脑 win7 64 位
编译器gcc 5.2.0 (32位64为兼容的)
#include <stdio.h>#include <stdlib.h>int main(int argc, char const *argv[]){ printf("the byte of char is %d\n", sizeof(char)); printf("the byte of signed char is %d\n", sizeof(signed char)); printf("the byte of unsigned char is %d\n", sizeof(unsigned char)); printf("///////////////////////////////////////////////////\n"); printf("the byte of int is %d\n", sizeof(int)); printf("the byte of signed int is %d\n", sizeof(signed int)); printf("the byte of unsigned int is %d\n", sizeof(unsigned int)); printf("///////////////////////////////////////////////////\n"); printf("the byte of short is %d\n", sizeof(short)); printf("the byte of long is %d\n", sizeof(long)); printf("the byte of signed short int is %d\n", sizeof(signed short int)); printf("the byte of unsigned short int is %d\n", sizeof(unsigned short int)); printf("the byte of signed long int is %d\n", sizeof(signed long int)); printf("the byte of unsigned long int is %d\n", sizeof(unsigned long int)); printf("the byte of signed long long int is %d\n", sizeof(signed long long int)); printf("the byte of unsigned long long int is %d\n", sizeof(unsigned long long int)); printf("///////////////////////////////////////////////////\n"); printf("the byte of float is %d\n", sizeof(float)); printf("the byte of double is %d\n", sizeof(double)); printf("///////////////////////////////////////////////////\n"); printf("the byte of int * is %d\n", sizeof(int *)); printf("the byte of char* is %d\n", sizeof(char*)); printf("the byte of float* is %d\n", sizeof(float*)); printf("the byte of double* is %d\n", sizeof(double*)); return 0;}
运行结果
我的各数据类型占字节数
char 1
int 4
float 4
double 8
short 2
long 4
long long 8
指针是 8
0 0
- C各种类型变量所占字节
- C语言中各种整型类型所占字节数
- C++各种类型变量所占大小
- 谈谈在java中各种类型变量所占的字节数(一)
- 变量所占字节
- 在C语言中各种类型数据所占字节数
- 变量类型所占内存C/C++
- int long等各种类型所占的字节数
- c++各种类型数据所占字节数
- C_basic_summary--各种类型数据所占字节数
- 各种类型在平台中所占的字节
- C语言的各种数据结构所占的字节数
- 笔记--关于c语言中各种数据类型所占字节。
- 各个类型所占字节
- C语言整型变量所占内存字节数
- C语言中指针变量所占字节大小
- linux学习之c语言变量所占字节数
- C/C++学习 - 基本类型所占字节数
- oracle 中常见日期查询语句
- nginx 下 location 某个文件夹下某类文件
- 苹果3元一个,鸭梨2元一个,桃子1元一个。现在想用200元买100个水果,在控制台中列出所有可能性。
- Codeforces Alpha Round #21 C. Stripe 2 【DP+标记想法】
- md语法入门
- C各种类型变量所占字节
- java IO
- Spring web过滤器-各种filter讲解
- 运行命令大全-上
- Windows多线程同步系列之三-----事件对象
- CentOS 7 x86_64适用的EPEL安装源 国内镜像列表
- 正则表达式贪婪与非贪婪模式
- python emacs 相关信息
- U-boot在S3C2440上的移植详解(一)