Names used for include guards?
问题 Are there any guidelines people tend to follow when selecting a name for their include guard? I don't understand why the name for the .h file will slightly differ from the name used in the include guard. For example, I have seen sphere.h and then #ifndef SPHERE_H_ . Could I just as easily have used SPHERE_ or do the names have to match? Are the underscores also necessary? 回答1: To pick a good name for a header guard, consider these points: 1) the name has to be unique, so make it long and