转换分为显式转换和隐式转换两种。
显式转换:说白了就是直接强制类型转换。如:
int tx,ty;
unsigned ux,uy;
tx = (int)ux;
uy = (unsigned)ty;
隐式转换:如果有符号数(无符号数)直接赋值给无符号数(有符号数),则存在隐式转换。如:
int tx,ty;
unsigned ux,uy;
tx = ux;
uy = ty;
转换分为显式转换和隐式转换两种。
显式转换:说白了就是直接强制类型转换。如:
int tx,ty;
unsigned ux,uy;
tx = (int)ux;
uy = (unsigned)ty;
隐式转换:如果有符号数(无符号数)直接赋值给无符号数(有符号数),则存在隐式转换。如:
int tx,ty;
unsigned ux,uy;
tx = ux;
uy = ty;