Hi guys,
Got a quick one this time.
Using a class Player (to store player name, etc) and having some trouble passing arrays as parameters.
In my definition of constructor, i have 2 arguments, first name and last name.
Now i have to use char arrays to store names.
In my Class Player, i have 2 private members, char arrays playerFirstName and playerLastName (both arrays hold 10 members).
eg:
private:
char playerFirstName[10];
char playerLastName[10];
why doesn't the below constructor work?
getting message: incompatible types in assignment of char* to char[10]...Code:Player::Player(char firstName[], char lastName[]) { playerFirstName = firstName; playerLastName = lastName; }
So does it want a pointer to an array or something along those lines?
Regards,
-Kirill