C
cppaddict
It struck me as odd today that while class definitions require a
semi-colon at the end, function definitions do not. I was curious if
this small syntactic difference represents a larger conceptual
difference between these two language constructs.
I know that a semi-colon is used to "end a statement," but why would a
function definition not be considered a statement, while a class def
is?
If there is a larger conceptual difference (other than the
unilluminating fact that one is a function and one a class), can
anyone explain what it is?
Thanks,
cpp
semi-colon at the end, function definitions do not. I was curious if
this small syntactic difference represents a larger conceptual
difference between these two language constructs.
I know that a semi-colon is used to "end a statement," but why would a
function definition not be considered a statement, while a class def
is?
If there is a larger conceptual difference (other than the
unilluminating fact that one is a function and one a class), can
anyone explain what it is?
Thanks,
cpp