Afternoon, C++.com!! I'm hoping you can help me with something that I'm sure is really simple. I'm writing my first class function and so far it's compiling and seems like it should work, but when I run it I'm getting the error:
"ZeroLink: unknown symbol '__ZN15CheckingAccountC1Ev'
assign 5 has exited due to signal 6 (SIGABRT)."
I have another program almost exactly like it which is running fine. Any help would be greatly appreciated!!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
class CheckingAccount
{
public:
//constructors
CheckingAccount(string full_name, double balance);
CheckingAccount();
void input();
// accessors
double get_balance();
string get_name();
void make_deposit();
void make_withdrawal();
private:
string full_name; // account holders full name
double balance; // balance of the account
};
1 2 3 4 5 6 7 8 9
int main()
{
cout << "Welcome to the CS240A Bank! We must first set up your account.\n";
CheckingAccount account1;
account1.input();
cout << "Your name is" << account1.get_name() << endl;
cout << "\nThe initial balance is $" << account1.get_balance() << endl;
return();
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
void CheckingAccount::input()
{
cout << "Please enter your name: ";
cin >> full_name;
cout << endl << "Please enter the current balance of your checking account: ";
cin >> balance;
cout << endl;
}
double CheckingAccount::get_balance()
{
return(balance);
}
string CheckingAccount::get_name()
{
return(full_name);
}
It may matter that I seem to be having problems with the string declaration...a string *can* be used in a class, correct? I'm using Xcode, if that makes any difference.