Can I avoid using the class name in the .cpp file if I declare a namespace in the header? [duplicate]
问题 This question already has answers here : C++: “Class namespaces”? [duplicate] (4 answers) Closed 7 years ago . In C++, all I want to do is declare a DisplayInfo class in a .h file, and then in the .cpp file, not have to type the first DisplayInfo::DisplayInfo() and every function definition. Sadly, I've looked at over 20 topics and my C++ book for over two hours now and have not been able to resolve this. I think it's because I'm trying to use my 10-year-old java training in C++. 1st trial: /