<sarcasam>wow Code King and Vorfin you are really helpful... </srcasam>
@Topic
You didn't initialize the class, take a look at the first two lines in main() and how the Check() is called, and the variable Name shouldn't be defined within the class
And also your function Check is set to return a string "string Check()" but it doesn't return a string wich may cause app to shutdown, instead of printing out the success message in Check() you should return it and cout when Check() is called
@Topic
You didn't initialize the class, take a look at the first two lines in main() and how the Check() is called, and the variable Name shouldn't be defined within the class
And also your function Check is set to return a string "string Check()" but it doesn't return a string wich may cause app to shutdown, instead of printing out the success message in Check() you should return it and cout when Check() is called
Code:
#include <cstdlib>
#include <iostream>
#include <string>
using namespace std;
class User
{
public:
string Name;
string Check(string x)
{
string com = Name;
if ( com == x)
{
return "You made it. Congratz";
}
}
};
int main()
{
User *user = new User();
user->Name = "Bob";
string x;
cout << "Enter your name to withdraw money : " ;
cin >> x;
cin.ignore();
cout << user->Check(x) << endl;
cin.get();
return 0;
}