The biggest issue for me is that with the direct declaration, you don't have
to check for NULL.
i use std::string a lot, and i can choose between the direct declaration or
the pointer declaration.
it becomes kind of tedious to always do
if(NULL == ptr)
{
//do cleanup
throw ExNullPtr("ptr was NULL")
}
that's why i try to use direct declaration as much as possible. one less
problem to check.
kind regards,
Bruno.
"Egbert Nierop (MVP for IIS)" <eg***********@nospam.invalid> wrote in
message news:ek**************@TK2MSFTNGP14.phx.gbl...
I use these classes rather a time but never could make up a reason to
decide between declaring a member variable as a pointer or directly.
For instance
CIcon m_icon;
or
CIcon * m_icon;
The visual programming-difference is that when you use a pointer, you need
to 'new' and to 'delete' the instances. But what are the other pros/cons?
Thanks!