C++中冒号的作用

一次偶然机会看见了一种以前没见过的写法,记录下来以后参阅学习。

class NoName{
public:
    NoName():pstring(new std::string), i(0), d(0){}   //new std::string pstring , i = 0 ; d = 0 ;
private:
    std::string * pstring;
    int i;
    double d;
};

猜你喜欢

转载自www.cnblogs.com/hpl20155329/p/9111014.html