相关疑难解决方法(0)

C++方法声明问题

我在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)

c++ methods syntax declaration

4
推荐指数
1
解决办法
3402
查看次数

标签 统计

c++ ×1

declaration ×1

methods ×1

syntax ×1