I thought I was starting to understand classes, but this error has been bugging me and I can't figure out what the problem is. Obvisouly I don't understand them as well as I thought I did ^_^. Here's a simple class attempt which returns the same error when I try to compile it
Code:#ifndef MYCLASS_H #define MYCLASS_H class MyClass { private: std::string a; public: MyClass(); MyClass( std::string a_ ); }; #endifCode:#include "myclass.h" MyClass::MyClass() { a = "Hello"; } MyClass::MyClass( std::string a_ ) { a = a_; }Here is the first error msg I get, I'm pretty sure I only need to fix one thing to get rid of the other messagesCode:#include "myclass.h" int main() { return 0; }
My guess is that it's got something to do with "std::string", but that's just a guess, the truth is I don't really know7 C:\Dev-Cpp\Projects\myclass.h using-declaration for non-member at class scope
Kind Regards
Stonehambey



LinkBack URL
About LinkBacks




