-
-
[旧帖]
[原创]C语言——基本数据类型和局部变量
0.00雪花
-
发表于:
2011-5-27 12:31
3954
-
[旧帖] [原创]C语言——基本数据类型和局部变量
0.00雪花
int _tmain(int argc, _TCHAR* argv[])
{
//bool
bool isTest = true;
//char
char cChar = 'T';
//int
int nNum = 0x123;
//float(double)
float fValue = 1.2f;
//double
double dfValue = 1.2;
return 0;
}
[B]//bool[/B]bool isTest = true;
isTest = 123;
isTest = 0.2;
isTest = 'a';
[B] //char[/B]
char cChar = 'T';
//char型
char cChar = 0x4;
for (; ; ++cChar) //增加方向0x5,0x6,0x7--->
{
printf("%02X\r\n", cChar);
if (cChar == 0x3)
{
printf("我又回来啦!\r\n");
break;
}
}
FFFFFFFE
FFFFFFFF
00
01
02
03
我又回来啦!
char cChar = 0x4; unsigned char cChar = 0x4;(无符号)
FD
FE
FF
00
01
02
03
我又回来啦!
[B] //int[/B]
int nNum = 0x123;
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课