Re: What is going on here?
From: Karl Heinz Buchegger (kbuchegg_at_gascad.at)
Date: 08/18/04
- Previous message: rs: "What is going on here?"
- In reply to: rs: "What is going on here?"
- Next in thread: James Dennett: "Re: What is going on here?"
- Reply: James Dennett: "Re: What is going on here?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 18 Aug 2004 13:47:46 +0200
rs wrote:
>
> I am trying to figure out what is going on with the constructor in the
> following class.
> What I can not figure out is why is there a colon and then the base class
> declaration in the constructor function.
Everything after the ':' up to the opening '{' is called the 'intializer
list'. Its use is to specify to the compiler what initializations should
occour. This can be: initializations of member variables or the initialization
of the base class this class is derived from.
>
> Why is there a semicolon after the inline definition { m_pMainWnd = NULL; }
> ;
It's just syntactic sugar. It doesn't need to be there, but it isn't
wrong either. As for the same reason as there is no error in
// Look Ma. Lots of empty statements
;
int main()
{
;
;
;
}
-- Karl Heinz Buchegger kbuchegg@gascad.at
- Previous message: rs: "What is going on here?"
- In reply to: rs: "What is going on here?"
- Next in thread: James Dennett: "Re: What is going on here?"
- Reply: James Dennett: "Re: What is going on here?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|