const char ?? 之間的關系
const char *p;
char const *pp;
char * const ppp = nullptr;
如何判斷系統(tǒng)是32位還是64位
int i = 10;
int *ptr = 0;
ptr = &i;
// 判斷一個指針的地址是多少 如果是是4 就是 32位 如果是 8 就是64位
cout<<"sizeof point = "<<sizeof(ptr)<<endl;
// 對0 取反
int a = ~0;
cout<<"a = "<<a<<endl;
如何比較兩個浮點數(shù)是否相等
const float EPSINON = 0.00000001;
float x = 48.93333;
float y = 48.93333;
if (abs(x-y) <= EPSINON) {
cout <<"x == y"<<endl;
}else{
cout<<"x != y"<<endl;
}