Hi team
I want to group a bunch of constants in a class in C++, how to I do that?
I want to group a bunch of constants in a class in C++, how to I do that?
C++:
// in ver.h
class VER{
public:
static const MAJOR = 0;
static const MINOR = 1;
};
// in main.cpp
#include <iostream>
#include "ver.h"
int main(int argc, char *argv[]){
printf("ver: %u.%u\n", VER.MAJOR, VER.MINOR);
return 0;
}