#include <iostream>
#include <string>
usingnamespace std;
class team //creating the class team
{
public:
string member;
void setMember(string x){
member = x;
}
string getMember(){
return member;
}
};
class Galeforce : public team{ //The subclass to the team Galeforce
public:
string getGaleforce(){
team tmg1;
team tmg2;
team tmg3;
tmg1.setMember("Kaydop");
tmg2.setMember("Voilentpanda");
tmg3.setMember("Turbopulsa");
cout<<tmg1.getMember()<<endl;
cout<<tmg2.getMember()<<endl;
cout<<tmg3.getMember()<<endl;
}
};
int main()
{
Galeforce gf;
cout<<gf.getGaleforce()<<endl;
return 0;
}
Now i get the three names then it stops working. If i do the exact same function it doesn't crash.