I thought it would be fairly simple but no matter I do, I get tons of errors
Code:
class stuff
{
int account;
string content;
public:
stuff()
{
account = 1;
content = "null";
}
stuff(int acc, string cont)
{
account = acc;
content = cont;
}
~stuff(){};
int GetAccount()
{
return account;
}
string GetContent()
{
return content;
}
void SetAccount(int Account)
{
account = Account;
}
void SetContent(string Content)
{
content = Content;
}
};
That's my humble class. All I'm trying to do is declare a variable of the type stuff .
I inserted a new method under the public keyword in the code pre-created by Visual Studio:
Code:
void DoSomething()
{
int number = 119;
String ^name = "Something";
stuff s(211, "Nothing");
};
When putting a parenthesis behind s, Visual Studio displays both available constructors for s but I still get the following errors:
Error 1 error C2065: 'stuff' : undeclared identifier
Error 2 error C2146: syntax error : missing ';' before identifier 's'
Error 3 error C3861: 's': identifier not found
Error 4 error C2065: 'stuff' : undeclared identifier
Error 5 error C2146: syntax error : missing ';' before identifier 's'
Error 6 error C3861: 's': identifier not found
What went wrong?
Thanks in advance.