Hi all,
I'l freely admit I suck at programming, decided to try and improve a bit, so took it as a module at uni. Just started trying to get to grips with it, and understand all the basics, and have managed to get classes working etc... but can't work out why this won't work :s (did Java a few years back so maybe thats confusing me!) I basically want to print the details out rather than calling the individual get's...
And this is the call in my main...
Any help appreciated!
OH the error!!
Says there is no such function in account.h ... and then suggests below that that "void displayDetails(char * accName, int dAccNum)" is the closest candidate... won't work though.
I'l freely admit I suck at programming, decided to try and improve a bit, so took it as a module at uni. Just started trying to get to grips with it, and understand all the basics, and have managed to get classes working etc... but can't work out why this won't work :s (did Java a few years back so maybe thats confusing me!) I basically want to print the details out rather than calling the individual get's...
account.h said:// Account.h
//Class File
class Account
{
private:
int nAccountNumber;
char strAccName[50];
public:
void SetAccountNumber(int);
void setHolderName(char *);
int getAccountNumber(void);
char * getHolderName(void);
void displayDetails(char*, int);
};
//Actual implementation of class
<SNIP>
void displayDetails(char * accName, int dAccNum)
{
std::cout << "Account name : " << accName << std::endl;
std::cout << "Account number : " << dAccNum << std::endl;
}
And this is the call in my main...
main.cpp said:cout << Steve.displayDetails() << endl;
Any help appreciated!
OH the error!!
Says there is no such function in account.h ... and then suggests below that that "void displayDetails(char * accName, int dAccNum)" is the closest candidate... won't work though.
Last edited: