Click here to Skip to main content
15,899,937 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: C++ destructor Pin
PJ Arends30-Nov-08 7:03
professionalPJ Arends30-Nov-08 7:03 
GeneralRe: C++ destructor Pin
Fred Andres30-Nov-08 7:27
Fred Andres30-Nov-08 7:27 
AnswerRe: C++ destructor Pin
Mark Salsbery30-Nov-08 7:19
Mark Salsbery30-Nov-08 7:19 
QuestionConverting an integer to a string. Pin
Quecumber25630-Nov-08 5:17
Quecumber25630-Nov-08 5:17 
AnswerRe: Converting an integer to a string. Pin
PJ Arends30-Nov-08 6:57
professionalPJ Arends30-Nov-08 6:57 
AnswerRe: Converting an integer to a string. Pin
Mark Salsbery30-Nov-08 7:24
Mark Salsbery30-Nov-08 7:24 
QuestionWhat is the difference between these 2 ways of declaring an object? Pin
KaKa'30-Nov-08 3:20
KaKa'30-Nov-08 3:20 
AnswerRe: What is the difference between these 2 ways of declaring an object? Pin
Jijo.Raj30-Nov-08 4:25
Jijo.Raj30-Nov-08 4:25 
KaKa' wrote:

Yes, in the first code snippet, an object pointer is declared while in the second one, it is a normal object.
Other than that,is there difference between these 2 ways of declaring an object?


The first code snippet, you have forward declared the class. So you don't need to include the corresponding header file. If both classes are independent one, it doesn't matter. Both code snippet work well.

Well, it does matter when you have two classes which circular dependency. In that case, your second code snippet won't work. Check out this link[^] for more information. So, in summery, both code snippets are not exactly the same in all conditions. Smile | :)

Regards,
Jijo.

_____________________________________________________

http://weseetips.com[^] Visual C++ tips and tricks. Updated daily.

GeneralRe: What is the difference between these 2 ways of declaring an object? Pin
KaKa'30-Nov-08 22:41
KaKa'30-Nov-08 22:41 
QuestionCFileDialog maximum file number Pin
followait30-Nov-08 2:31
followait30-Nov-08 2:31 
AnswerRe: CFileDialog maximum file number Pin
PJ Arends30-Nov-08 6:50
professionalPJ Arends30-Nov-08 6:50 
GeneralRe: CFileDialog maximum file number Pin
Hans Dietrich30-Nov-08 23:36
mentorHans Dietrich30-Nov-08 23:36 
QuestionIWebBrowser2 focus problem with IE6 Pin
YaronNir30-Nov-08 1:04
YaronNir30-Nov-08 1:04 
AnswerRe: IWebBrowser2 focus problem with IE6 Pin
PJ Arends30-Nov-08 7:12
professionalPJ Arends30-Nov-08 7:12 
GeneralRe: IWebBrowser2 focus problem with IE6 Pin
YaronNir30-Nov-08 19:35
YaronNir30-Nov-08 19:35 
GeneralRe: IWebBrowser2 focus problem with IE6 Pin
PJ Arends1-Dec-08 8:22
professionalPJ Arends1-Dec-08 8:22 
GeneralRe: IWebBrowser2 focus problem with IE6 Pin
YaronNir1-Dec-08 22:06
YaronNir1-Dec-08 22:06 
QuestionArray of Pointers to Functions & Math [modified] Pin
evdoxus30-Nov-08 0:04
evdoxus30-Nov-08 0:04 
AnswerRe: Array of Pointers to Functions & Math Pin
Richard Andrew x6430-Nov-08 3:44
professionalRichard Andrew x6430-Nov-08 3:44 
QuestionWM_CTLCOLOREDIT with Multiline Dialog Edit control Pin
ForNow29-Nov-08 15:53
ForNow29-Nov-08 15:53 
AnswerRe: WM_CTLCOLOREDIT with Multiline Dialog Edit control Pin
PJ Arends30-Nov-08 7:05
professionalPJ Arends30-Nov-08 7:05 
GeneralRe: WM_CTLCOLOREDIT with Multiline Dialog Edit control Pin
ForNow30-Nov-08 7:35
ForNow30-Nov-08 7:35 
GeneralRe: WM_CTLCOLOREDIT EM_POSFROMCHAR&TextOut Pin
ForNow30-Nov-08 9:18
ForNow30-Nov-08 9:18 
QuestionA Question about Input Fields Pin
BobInNJ29-Nov-08 13:46
BobInNJ29-Nov-08 13:46 
AnswerRe: A Question about Input Fields Pin
Christian Graus29-Nov-08 14:36
protectorChristian Graus29-Nov-08 14:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.