摘要:
(1)枚举默认为unsigned int类型,我们可以手动为枚举指定类型,如:enum Attr : char{ ATTR_LV = 120,};(2)我们可以使用泰勒展开式快速计算两点间距离:int fastDistance2D( int _nX1, int _nY1, int _nX2, int _nY2 ){ // this function computes the distance from _nX1, _nY1 to _nX2, _nY2 with 3.5% error // first compute the absolute value of (_nX2 - ... 阅读全文