How to avoid typing std::string in C++

1 Answer

0 votes
#include <iostream>

using std::string;

class Test {
    private: 
        string m_s = "C++";
    public:
        void Print() const {
            std::cout << m_s;
        }
            
    
};

int main() {
    Test t;
    
    t.Print();
}




/*
run:

"C++"

*/

 



answered Feb 26, 2022 by avibootz

Related questions

1 answer 135 views
135 views asked Feb 26, 2022 by avibootz
2 answers 94 views
1 answer 116 views
1 answer 128 views
1 answer 84 views
...