>>>newbox.name=name;
you can't do this...
>>>newbox.name=name;
you can't do this...
Last edited by Betazep; 03-16-2002 at 08:37 PM.
Blue
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...
Blue
sorry, i missed your code post. I still get the same error. this is ........ing me off so much!
Environment: OS X, GCC / G++
Codes: Java, C#, C/C++
AOL IM: neandrake, Email: neandrake (at) gmail (dot) com
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???
Blue
well, I added a ; to the end of the class declaration, and now I still get that weird error! GAR!!!!!!!!!!!!!
Environment: OS X, GCC / G++
Codes: Java, C#, C/C++
AOL IM: neandrake, Email: neandrake (at) gmail (dot) com
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; }
Blue
i just tried that exact code again. this time it works. maybe today is a better day. I will try my code.
Environment: OS X, GCC / G++
Codes: Java, C#, C/C++
AOL IM: neandrake, Email: neandrake (at) gmail (dot) com
My code still gives errors on the constructor. Same single error. Here's an update to my code:
Last edited by neandrake; 03-17-2002 at 10:47 AM.
Environment: OS X, GCC / G++
Codes: Java, C#, C/C++
AOL IM: neandrake, Email: neandrake (at) gmail (dot) com
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.
Environment: OS X, GCC / G++
Codes: Java, C#, C/C++
AOL IM: neandrake, Email: neandrake (at) gmail (dot) com
const RIGHT=2;
const LEFT=3;
I bet you are getting errors here too.
How does the compiler know they are ints or defines?
Blue
no, I don't get errors there, but it's bad programming. thanks for pointing that out.
updated version:
Environment: OS X, GCC / G++
Codes: Java, C#, C/C++
AOL IM: neandrake, Email: neandrake (at) gmail (dot) com