文章目录

command_conquer_red_alert_2_conceptart_8l1tm

C++中基本内置类型指:算术类型(arthmetic type)、和空类型(void)

  1. 算术类型:字符、整型数、布尔值、浮点数
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <iostream>

using std::cout;
using std::endl;
int main()
{

unsigned char i = -1;
printf("%d\n", i);

printf("******\n");
cout << i << endl;

printf("*****************************\n");
unsigned char j = '-1';
printf("%d\n", j);
cout << j << endl;
return 0;

}
  1. 空类型:用于特殊的场合,例如最常见的是,当函数不返回任何值时使用空类型最为返回类型。
文章目录