I'm trying to assign an array to an array however I'm having some problems,
here is my class;
Code:
class Transaction {
public:
Transaction::Transaction();
Transaction::Transaction(float InAmount, char InCode, char InNote[]);
int Transaction::SetAmount(float NewAmount);
float Transaction::GetAmount();
int Transaction::SetCode(char NewCode);
char Transaction::GetCode();
int Transaction::SetNote(char *NewNote);
int PrintNote();
private:
float Amount;
char Code;
char Note[20];
};
here is the overloaded constructor;
Code:
Transaction::Transaction(float InAmount, char InCode, char InNote[]) {
Amount = InAmount;
Code = InCode;
Note = InNote;
}
when I try to compile I get a "cannot convert from 'char []' to 'char [20]'" error.
If I declare note like this. "char *Note" it compiles fine but when I try to run the program it crashes....
can someone help??