I am pretty new to this, and I am completely lost as to what is happening. I am working on a project that require us to use Dynamic Memory Allocation and pointers to a class. This is what I've got so far, but I'm not sure what I am doing wrong. I know that the program is not complete, but I feel like I need to get past this one problem before I can finish.
I'm getting this error. Line 94: error: no matching function for call to 'CheckingAccount::CheckingAccount();
What should I change to correct this problem? I am confused as to what you mean by I am trying to create a new CheckingAccount calling the constructor with no parameters.
You have the data and you have the function required to write. All you need to do is tell your function to output the variables holding the data, which can be done like any other output:
1 2
int a = 5;
cout << "The value of a: " << a << ".\n";
To your last question: Do you mean "what does this code do?"? If so: that's a constructor. It allows you to initialize an object of your class and assign starting values to its members.
Too much work? Without the constructor, you have to assign all values manually using set*() functions (which is more work, and also stupid).
You already have all the code required to "make two accounts". If you simply fill in the rest of your display_account_information() function, you'll be done.
Gaminic, you don't realize what you've done. I am having a VERY hard week this week, and I feel like you've just lifted a ton of bricks off my shoulders.
Even if this isn't the way he wanted the assignment, it's the way he's getting it.
Well, Gaminic... I thought we had it. But I just talked to the teacher and I wasn't even close to what he was looking for. I've re written my code from the ground up and having some issues with my pointer to a class.
The error is occuring on line 96 "no matching function for call to 'CheckingAccount::CheckingAccount()"
Perhaps you should consider removing all the parameters from your constructor on lines 66 and 70? It seems that what you want there is a default constructor. If you do that, then the error on line 96 should be fixed.