fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class Oblast
  5. {
  6. public :
  7. int name ;
  8. void show_Oblast(void)
  9. {
  10. cout << "Название: " << name << endl;
  11.  
  12. };
  13.  
  14. class Megapolis : public Oblast
  15. {
  16.  
  17. };
  18.  
  19. class Gorod : public Megapolis
  20. {
  21.  
  22. };
  23. class Mesto : public Gorod
  24. {
  25.  
  26. };
  27. int main()
  28. {
  29. Oblast A;
  30. strcpy(A.name = 10);
  31. A.show_Oblast();
  32.  
  33. return 0;
  34. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:14:30: error: invalid use of incomplete type ‘class Oblast’
     class Megapolis : public Oblast
                              ^
prog.cpp:4:11: error: forward declaration of ‘class Oblast’
     class Oblast
           ^
prog.cpp:34:5: error: expected ‘}’ at end of input
     }
     ^
prog.cpp: In member function ‘int Oblast::main()’:
prog.cpp:30:23: error: ‘strcpy’ was not declared in this scope
     strcpy(A.name = 10);
                       ^
prog.cpp: At global scope:
prog.cpp:34:5: error: expected unqualified-id at end of input
     }
     ^
stdout
Standard output is empty