#include "stdafx.h"
int main(int argc, char* argv[])
{
char c = 0;
short s = 0;
int i = 0;
printf("%d, %d\n", sizeof(char), sizeof(c));
printf("%d, %d\n", sizeof(short), sizeof(s));
printf("%d, %d\n", sizeof(int), sizeof(i));
return 0;
}
// c_1.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include<stdio.h>
typedef int INT32;
typedef unsigned char BYTE;
typedef struct _demo
{
short s;
BYTE b1;
BYTE b2;
INT32 i;
}DEMO;
int main(int argc, char* argv[])
{
INT32 i32;
BYTE byte;
DEMO d;
printf("%d ,%d\n" ,sizeof(INT32),sizeof(i32));
printf("%d ,%d\n" ,sizeof(BYTE),sizeof(byte));
printf("%d ,%d\n" ,sizeof(DEMO),sizeof(d));
printf("Hello World!\n");
return 0;
}
编译环境:VC++6.0
1.数据类型, 就是, 数据的类型.
2. C语言基本的数据类型包括.
short、int、long、char、float、double 这六个关键字代表C 语言里的六种基本数据类型。