I'm trying to assign an array to an array however I'm having some problems,
here is my class;
here is the overloaded constructor;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]; };
when I try to compile I get a "cannot convert from 'char []' to 'char [20]'" error.Code:Transaction::Transaction(float InAmount, char InCode, char InNote[]) { Amount = InAmount; Code = InCode; Note = InNote; }
If I declare note like this. "char *Note" it compiles fine but when I try to run the program it crashes....
can someone help??



LinkBack URL
About LinkBacks


