fork download
  1. #include <cstring>
  2. #include <iostream>
  3. using namespace std;
  4. class dogs
  5. {
  6. public:
  7. char breed[64];
  8. int average_weight;
  9. int average_height;
  10. void show_dog(void) ;
  11. };
  12.  
  13. void dogs::show_breed(void)
  14.  
  15. {
  16. cout << "Порода: " << breed << endl;
  17. cout << "Средний вес: " << average_weight << endl;
  18. cout << "Средняя высота: " << average_height << endl;
  19. }
  20.  
  21. int main()
  22.  
  23. {
  24. dogs happy, matt;
  25. strcpy(happy.breed, "Долматин") ;
  26. happy.average_weight = 58;
  27. happy.average_height = 24;
  28.  
  29. strcpy(matt.breed, "Колли");
  30. matt.average_weight =22;
  31. matt.average_height = 15;
  32.  
  33. happy.show_breed() ;
  34. matt.show_breed();
  35. return 0;
  36. }
  37.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:13:27: error: no ‘void dogs::show_breed()’ member function declared in class ‘dogs’
 void dogs::show_breed(void)
                           ^
prog.cpp: In function ‘int main()’:
prog.cpp:33:10: error: ‘class dogs’ has no member named ‘show_breed’
    happy.show_breed() ;
          ^
prog.cpp:34:9: error: ‘class dogs’ has no member named ‘show_breed’
    matt.show_breed();
         ^
stdout
Standard output is empty