class and giving in function or class problems ???
I know how to get valuables from functions and classes
but I don't know how to put in to them
Code:
#include <iostream>
#include <string>
using namespace std;
class login
{
private:
string name;
public:
string return_name ()
{
cout << "before you enter to our games please tell us your name\n\n";
getline (cin, name);
cout << "thank you for sharring information " << name << endl;
return name;
}
};
class namex
{
cout << "nameq\n";
}
int namey ()
{
cout << "nameq\n";
return 0;
}
int main()
{
login log;
string nameq;
nameq = log.return_name ();
cout << "hello: "<< nameq <<"\n\n\n";
namex ();// don't know how to put here that name I input in login
namey ();// don't know how to put here that name I input in login
return 0;
}
please fill up what is missing
or repair
I'll learn much from this