Use C ++ instead of C (1)

xiaoxiao2021-03-06  14

Use C instead of C

1. Use const instead of #define to create a constant 2. Replace #define with enum to create a constant collection 3. Inline function instead #define macro 4. Use new and delete instead of Malloc and Free5. Use the input and output stream ( iostreams instead of stdio6. Select C language instead of C pre-processed, but you need to use preprocessors 7 when you debug code. Detect the value of the floating point pointer. The floating point pointer does not have a precise binary representation, so don't expect them to have precise values. Therefore, it is also necessary to use a method of comparing the values ​​of the two floating point pointers to determine whether the two are equal. EG: #include IF (FABS (FltValue - 42.0)

转载请注明原文地址:https://www.9cbs.com/read-49810.html

New Post(0)