I just started a program today, and only got the first function finished when I ran into problems. Just my luck. Anyway, I'm not exactly sure what the problem is, because I have just recently learned about arrays. Well...here's what I have(like I said, its the very beginning):
void getnames(char pl1, char pl2);
char player1, player2;
printf("%c %c", player1, player2);
/*Function to Get the Players' Names*/
void getnames(char pl1, char pl2)
printf("Player 1, Please Enter Your Name: ");
scanf(" %c", &pl1);
printf("Player 2, Please Enter Your Name: ");
scanf(" %c", &pl2);
The error I get is this:
"error C2664: 'getnames' : cannot convert parameter 1 from 'char ' to 'char'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast"
I am using The Microsoft Visual C++ compiler (v6.0)...sometimes I get errors with it that I won't with Turbo C++. Anyway, I tried using getnames(&player1, &player2), though they (to my knowledge) do the same thing. I really dunno what's wrong, all I want to do is get and store the 2 players' first names (I added the printf to see if it was working right, little did I know that I wouldn't even get that far) into the arrays.
But please remember, I'm new to arrays, so don't be too harsh if its a glaring error...I won't pick up on those for some time yet... =P
Any help would be much appriciated. = )