Does a class string always gets initialized to empty? [duplicate]

  access-modifiers, c++, initialization, private, string

I have this string s and t in class.

class A
{
    private:
    static string s;
    string t;
    public:
    void printString()
    {
        cout<<s<<t<<endl;
    }
};

I tried printing these string and everytime they were empty if not initialized. So my question is whether a class string is always empty before initialization by a constructor. Also is it true for both static and non static strings?

Source: Windows Questions C++

LEAVE A COMMENT