在C/C++中,说(1U)与((unsigned int)1)?之间有区别吗?我更喜欢第二个,但我担心第二个可能在运行时进行类型转换(即额外的cpu周期),而第一个在编译时获得正确的类型.谢谢.
(1U)
((unsigned int)1)
c c++ macros unsigned constants
c ×1
c++ ×1
constants ×1
macros ×1
unsigned ×1