![]() |
| ||
| inherit class from structure Hi, Is this valid in C++?? struct A{...}; class B: public A{...}; Thanks! |
| ||
| Re: inherit class from structure In C++ A Struct IS a Class. The only difference is that in a class, the members by default are private. In a Struct, they are by default public. |
| ||
| class base { protected: struct node{}; }; class derived :public base { struct node *prev; }; when i do this i 'm getting an error that prev is not a member of base::node. what can i do if i want to declare an additional variable of struct node type in class derived |
| ||
| richard bach, when I compile exactly what you have, i don't get a problem. Using Visual Studio 2008. V.9.021022.8 #include <iostream> I compile that and no errors, and I do actually get the numbers. I don't know to what extend this works, but to this, it is working. |
| All times are GMT -4. The time now is 8:30 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC