class car {
staticconstint foo = 5;
};
5 == car::foo
The foo is a variable, but it is almost global variable. Foo exists even when you have no cars. No instance of car uses memory for foo. The class scope limits who can access foo.
1 2 3
class car {
enum bar { foo = 5 };
};
No variable, just a literal constant value. However, now there is a type too: bar.
std::cout << "Hello";
"Hello" is not a variable. It is a literal constant value.