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_ );
};
#endif
Code:
#include "myclass.h"
MyClass::MyClass()
{
a = "Hello";
}
MyClass::MyClass( std::string a_ )
{
a = a_;
}
Code:
#include "myclass.h"
int main()
{
return 0;
}
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 messages
7 C:\Dev-Cpp\Projects\myclass.h using-declaration for non-member at class scope
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 know
Kind Regards
Stonehambey