fork download
  1. #include <iostream>
  2. #include <string.h>
  3. using namespace std;
  4.  
  5. class Oblast
  6. {
  7. public :
  8. int name ;
  9.  
  10. {
  11. cout << "Название: " << name << endl;
  12.  
  13. };
  14. };
  15.  
  16. class Megapolis : public Oblast
  17. {
  18.  
  19. };
  20.  
  21. class Gorod : public Megapolis
  22. {
  23.  
  24. };
  25. class Mesto : public Gorod
  26. {
  27.  
  28. };
  29. int main()
  30. {
  31. Oblast A;
  32. strcpy(A.name = 10);
  33.  
  34. return 0;
  35. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:10:5: error: expected unqualified-id before ‘{’ token
     {
     ^
prog.cpp: In function ‘int main()’:
prog.cpp:32:23: error: invalid conversion from ‘int’ to ‘char*’ [-fpermissive]
     strcpy(A.name = 10);
                       ^
prog.cpp:32:23: error: too few arguments to function ‘char* strcpy(char*, const char*)’
In file included from prog.cpp:2:0:
/usr/include/string.h:125:14: note: declared here
 extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
              ^
stdout
Standard output is empty