Posted on 2008-08-13 08:31
空气稀薄 阅读(73)
评论(0) 编辑 收藏 引用 所属分类:
C/C++
一、基本类型
整型类型:常量 八进制012、十进制10和十六进制0xA
变量 short、int和long (short 占两个字节,int 和 long占四个字节)
实数类型:常量
十进制5.678和指数形式567.8E-2
变量 float和double (float 占四个字节,double占八个字节)
字符类型: 常量 'g'、'我'
变量 char和wchar_t (char占一个字节,wchar_t占两个字节)
字符串型: 常量 "How are you?" => 'H' 'o' ................'?' '\n' (C语言字符串表示方法char[])
符号常量:#define PI 3.14159
二、构造类型
数组:int lstCount[10];
自定义类型:class Tag_CTag{int intCount; char name[20]} CCar;
struct Tag_Car{int intCount; char name[20]} Car;
联合 unit Sale{ int intCount; char name[20]}; //同用一块最大限度的内存块
指针类型:int *pCount;
三、修辞符
signed unsigned 有无符号 (数值类修辞符)
short long 长短型整数 (int类型修辞符)