Crexyyy
Hectopat
- Katılım
- 20 Şubat 2022
- Mesajlar
- 2.024
- Çözümler
- 2
Daha fazla
- Cinsiyet
- Erkek
C++:
///MAIN.CPP
#include <iostream>
#include "Employee.h"
using namespace std;
int main()
{
Employee Crexy;
Crexy.ID=8;
Crexy.age=18;
Crexy.salary=10000;
Crexy.name="Crexy";
Crexy.department="Computer Engineering";
Crexy.ShowInfos();
return 0;
}
C++:
///EMPLOYEE.H
#ifndef EMPLOYEE_H_INCLUDED
#define EMPLOYEE_H_INCLUDED
#include <iostream>
using namespace std;
class Employee{
public:
string name;
int age;
string department;
int ID;
int salary;
void ShowInfos();
};
#endif // EMPLOYEE_H_INCLUDED
Kod:
///EMPLOYEE.CPP
#include "Employee.h"
#include <iostream>
void Employee::ShowInfos() {
cout << Employee::name << endl;
cout << Employee::age << endl;
cout << Employee::department << endl;
cout << Employee::ID << endl;
cout << Employee::salary << endl;
}
Kod:
///KONSOLDAKI HATA
undefined reference to `Employee::ShowInfos()'
collect2.exe: error: ld returned 1 exit status