0

i'm using visual studio 2019
i'm trying to scan 2 characters 1 by 1 and for some reason it ignores completely from the other variable. i've tried everything , it can only read 1 variable each time , but once i declare a second variable it ignores the second one . what can i do to fix it ??
i press a button and the program is termainted. it wont even pass to the scanning part

int main(void)

{
    char player1;
    char player2;
    scanf_s("%c",&player1,1);
    printf("%c",player1);
    scanf_s("%c", &player2, 1);
    printf("%c", player2);

    

    _getch();
    return (1);
}
avihu24
  • 55
  • 5

0 Answers0