's answer is good. I will just add a note about question 2: the
In this case the code will compile with or without the
. The code writer just wanted to focus on the fact that this function is not part of his class but is part of the global scope as tolw
already told you.
You will find similar things about
syntax: a few people will write
Instead of directly accessing the variable:
Even though it would compile without
, the coder wants to show that
is part of the class.
Actually, MFC naming convention prefered to prefix variable names with
when they are members of a class (
of course), which makes the use of
I sometimes find people naming their local
! Please don't do that since it brings only confusion...