Is this C ++ code correct?
const size_t tabsize = 50;
int tab[tabsize];
The problem is that I have already seen numerous conflicting opinions on this issue. Even people in the ## C ++ IRC channel and programming forums claim to have fundamentally different things.
Some say the code above is correct.
Others argue that this is not the case, and that it must necessarily be as follows:
constexpr size_t tabsize = 50;
int tab[tabsize];
Since I'm already quite confused by the conflicting opinions of “C ++ experts,” can I ask for a reasonable fallback answer? Many thanks!
source
share