I'm starting to learn C++ and just out of curiosity, why does C++ require you to put a ";" at the end of the class declaration for example:
class A
{
/*...*/
};
In languages like java, it's used to signify an end of a statement.
What is different about
int i(5);
and the class above with regards to the semi-colon in C++? Does the compiler treat the class as a statement or does it have a different interpretation for it?
because you can also define variables in the declaration:
Ending class declarations in a semicolon is basically saying explicitly that we are not declaring any variables of this type.