我在Image.cpp中有一些代码:
Image::Image( int width, int height, int depth ) : m_sFileName(0)
{
...
}
and in Image.h:
class Image: public DrawAble, public RenderAble
{
...
private :
std::string *m_sFileName;
};
Run Code Online (Sandbox Code Playgroud)
我的问题是:m_sFilename第一行发生了什么?我猜它被设置为NULL,但这样做的重点是什么.做同样的事情是这样的:
Image::Image( int width, int height, int depth )
{
m_sFileName(0);
...
}
Run Code Online (Sandbox Code Playgroud)