I do not know whats going on. The program seemed to work fine on visual studio. Maybe I got something wrong and I cant spot it.. Please someone help me out with this one.
#include <iostream>
#include<string>
#include<cstdlib>
using namespace std;
class Aokiji
{
private:
string name1;
string name2;
public:
string setName(string x)
{
name1=x;
}
string getName()
{
return name1;
}
};
int main()
{
Aokiji Grapes;
Grapes.setName("I got it!");
cout<< Grapes.getName()<< endl;
system("pause");
}