RE: [Dev-C++] In constructor parameter list x = null
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Somanathan K. <som...@wi...> - 2003-03-31 13:19:52
|
Hi, Its assigning a default value NULL to pParent. If you call this proc with a valid pointer it will override this value. This is for error checking (Defensive programming). Somanathan -----Original Message----- From: Daniel Glenfield [mailto:sp...@ho...] Sent: Monday, March 31, 2003 6:30 PM To: dev...@li... Subject: [Dev-C++] In constructor parameter list x = null Can someone explain this to me? It's in a header file for a class declaration, for the only constructor of the class. CPenWidthsDlg(CWnd* pParent = NULL); It's derived from CDialog so I assume that's got something to do with it. I am just confused why the parameter is assigned a NULL value. If I pass in a pointer will it just get assigned to NULL? then what's the point? To save me from having to assign it to NULL in the constructor body or something? _________________________________________________________________ Get Hotmail on your mobile phone http://www.msn.co.uk/msnmobile/mobilehotmail ------------------------------------------------------- This SF.net email is sponsored by: ValueWeb: Dedicated Hosting for just $79/mo with 500 GB of bandwidth! No other company gives more support or power for your dedicated server http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/ _______________________________________________ Dev-cpp-users mailing list Dev...@li... TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |