| | |
inherit class from structure
Thread Solved
![]() |
•
•
Join Date: Oct 2007
Posts: 1
Reputation:
Solved Threads: 0
0
#4 14 Days Ago
richard bach, when I compile exactly what you have, i don't get a problem.
Using Visual Studio 2008. V.9.021022.8
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.
Using Visual Studio 2008. V.9.021022.8
C++ Syntax (Toggle Plain Text)
#include <iostream> using namespace std; class base { protected: struct node{}; }; class derived :public base { struct node *prev; }; class A { public: int a; }; struct B : A { }; struct C { public: int c; }; class D : public C { }; int main() { B b; D d; b.a = 1; d.c = 2; cout << b.a << " " << d.c << endl; }
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.
![]() |
Similar Threads
- Please help me to convert a simple C++ program into an object-oriented one. (C++)
- Several C++ Designing Questions (C++)
- What is the best value for an empty point in C++? (C++)
- Basketball League Project (C)
- Inheritance Questions (C++)
- Why use a Python class? (Python)
- Dynamically Print Out Structure Contents (C++)
- accessing private data members (C++)
Other Threads in the C++ Forum
- Previous Thread: Problem deleting pointers from list
- Next Thread: File Creation Program
| Thread Tools | Search this Thread |
addition api array base based binary bitmap c++ c/c++ char class classes code coding compile console conversion count delete deploy desktop developer directshow dll download dynamic dynamiccharacterarray email embed encryption error erroraftercompilation excel file forms fstream function functions game getline givemetehcodez gmail graph gui homework homeworkhelp homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker loop looping loops map math matrix matrix3d memory multiple news node output parameter pointer problem program programming project python random read recursion reference rpg std::coutwstring string strings temperature template test text text-file tree url variable vector video visualization win32 windows winsock word wordfrequency wxwidgets






