>>>newbox.name=name;
you can't do this...
Printable View
>>>newbox.name=name;
you can't do this...
I gotta go... keep trying. Write a more simple class. Work your errors from there. The parenthesis go after the constructor and destructor. Your errors are elsewhere...
sorry, i missed your code post. I still get the same error. this is ........ing me off so much!
you got that error with the code that I posted?
someone more familiar with MSVC++ is going to have to help you.... I do not know why that would happen
Prelude... got any ideas???
well, I added a ; to the end of the class declaration, and now I still get that weird error! GAR!!!!!!!!!!!!!
so you tried just like that? This compiles absolutely fine for me.Code:class test
{
public:
test();
int a;
};
test::test()
{
a = 0;
}
int main()
{
test it;
return 0;
}
i just tried that exact code again. this time it works. maybe today is a better day. I will try my code.
My code still gives errors on the constructor. Same single error. Here's an update to my code:
problem is not with the constructor, it's in the deconstructor. I commented out first the constructor and got errors. then i commented out just the deconstructor and it compiled fine.
const RIGHT=2;
const LEFT=3;
I bet you are getting errors here too.
How does the compiler know they are ints or defines?
no, I don't get errors there, but it's bad programming. thanks for pointing that out.
updated version: