fork download
  1. #pragma once
  2. class Employee
  3. {
  4. public:
  5. Employee(std::string sName, std::string sYMD, int iYears, int iSalary);
  6. ~Employee();
  7. private:
  8. std::string m_sName;
  9. std::string m_sBirthday;
  10. int m_iYears;
  11. int m_iSalary;
  12. public:
  13. //Set Operation
  14. void SetName(std::string sName) {};
  15. void SetBirthday(std::string sYMD) {};
  16. void SetYear(int iYears) {};
  17. void SetSalary(int iSalary) {};
  18. //Get Operation
  19. std::string GetName(void) {};
  20. std::string GetBirthday(void) {};
  21. int GetYear(void) {};
  22. int GetSalary(void) {};
  23. void form(void) {};
  24. };
  25.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:9: warning: #pragma once in main file
 #pragma once
         ^
prog.cpp:5:23: error: expected ')' before 'sName'
  Employee(std::string sName, std::string sYMD, int iYears, int iSalary);
                       ^
prog.cpp:8:7: error: 'string' in namespace 'std' does not name a type
  std::string m_sName;
       ^
prog.cpp:9:7: error: 'string' in namespace 'std' does not name a type
  std::string m_sBirthday;
       ^
prog.cpp:14:20: error: 'std::string' has not been declared
  void SetName(std::string sName) {};
                    ^
prog.cpp:15:24: error: 'std::string' has not been declared
  void SetBirthday(std::string sYMD) {};
                        ^
prog.cpp:19:7: error: 'string' in namespace 'std' does not name a type
  std::string GetName(void) {};
       ^
prog.cpp:20:7: error: 'string' in namespace 'std' does not name a type
  std::string GetBirthday(void) {};
       ^
stdout
Standard output is empty