Programı çalıştırmak istediğimle hata alıyorum. Hatalar 31. ve 33. satırda.
[CODE lang="cpp" title="cpp"]#include <iostream>
#include <string>
using namespace std;
class Employee.
{
private:
string name;
public:
void isimkoy(string isim)
{
name = isim;
}
string isimyaz()
{
return name;
}
};
int main()
{
Employee* employee = new Employee();
employee-->isimkoy("Alper");
cout << employee-->isimyaz();
return 0;
}
[/CODE]
Hatanın sebebi ve çözümü nedir?
[CODE lang="cpp" title="cpp"]#include <iostream>
#include <string>
using namespace std;
class Employee.
{
private:
string name;
public:
void isimkoy(string isim)
{
name = isim;
}
string isimyaz()
{
return name;
}
};
int main()
{
Employee* employee = new Employee();
employee-->isimkoy("Alper");
cout << employee-->isimyaz();
return 0;
}
[/CODE]
Hatanın sebebi ve çözümü nedir?
Son düzenleyen: Moderatör: