1、类之于对象好比数据类型至于变量,说白了对象是类的实例;举例:类是所有著名演员,对象是某一个著名演员。
2、sizeof 运算符,返回类型或变量的长度,单位为字节
3、十进制cout << dec; 八进制(0开头)cout << oct; 十六进制(0x开头)cout << hex;
#include <iostream>
using namespace std;
int main(void)
{
int cheat = 42;
int waist = 0x42;
int inseam = 042;
cout << "cheat= " << cheat << "(in dec)" <<endl;
cout << hex;
cout << "waist= " << waist <<"(in hex)" << endl;
cout << oct;
cout << "inseam= " << inseam << "(in oct)" << endl;
return 0;
}
4、浮点数在计算机中是以,二进制科学计数法存储的