int、float、double
int is a 32-bit (8 bits = 1 byte, ie 4 bytes) integer variable
float is a 32-bit (4-byte) floating-point number
double is a 64-bit floating point number (8 bytes)
Type conversion during assignment in C++
//1.数值赋值中的类型转换
uint8_t s = 45;
double d = s; //正确
double d = (double)s;//两种形式都可,数值默认会进行隐式类型转换
//地址赋值中的类型转换(必须强制转换)
uint8_t* ps = &s;
double* a = ps; //错误
double* a = (double*) ps; //地址不会默认进行隐式类型转换,必须要前面进行强制类型转换
//C和C++中强制类型转换的两种方式
double* pTime = (double*)( &(clouddata->data[(pointBytes*p) + offset_time]));//C中强制类型转换的方式
const double* pTTime = reinterpret_cast<const double*>( &(clouddata->data[(pointBytes*p) + offset_time]));//C++中强制类型转换的方式