我正在研究的程序有很多适用于所有类的常量.我想制作一个头文件"Constants.h",并能够声明所有相关的常量.然后在我的其他课程中,我可以包括#include "Constants.h.
#include "Constants.h
我使用#ifndef... #define ...语法使其工作正常.但是,我更喜欢使用const int...常量的形式.我不太清楚如何.
#ifndef
#define ...
const int...
c++ header constants
c++ ×1
constants ×1
header ×1