fork download
  1. #include <iostream>
  2. #include <string.h>
  3. using namespace std;
  4.  
  5. class employee
  6.  
  7. {
  8. public:
  9. char name [64];
  10. long employee_id;
  11. float salary;
  12. void show_employee(void)
  13.  
  14. {
  15. cout << "Имя: " << name << endl;
  16. cout << "Номер служащего: " << employee_id << endl;
  17. cout << "Оклад: " << salary << endl;
  18. };
  19. };
  20.  
  21. void main(void)
  22.  
  23. {
  24. employee worker, boss;
  25. strcpy(worker.name, "John Doe");
  26. worker.employee_id = 12345;
  27. worker.salary = 25000;
  28. strcpy(boss.name, "Happy Jamsa");
  29. boss.employee_id = 101;
  30. boss.salary = 101101.00;
  31. worker.show_employee();
  32. boss.show_employee();
  33.  
  34. return 0;
  35. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:21:15: error: ‘::main’ must return ‘int’
 void main(void)
               ^
stdout
Standard output is empty