I was wondering if anyone could tell me why the second scanf is skipped after i enter one number and then hit enter? I am trying read two values from the keyboard and send them through a pipeline. Does anyone know which function to call for the program to store the keyboard character that is pressed to a char variable right after the key has been pressed without a following enter (line carriage)? Thanks!
Code:while(1) { printf("Please select the elevator car letter (A, B, C) or Up/Down arrows : "); scanf("%c", &temp); printf("%c\n", temp); // Add character append function calls printf("Please enter the floor number (0 - 9) : "); scanf("%c", &temp); printf("%c\n", temp); // Add character append function calls }



LinkBack URL
About LinkBacks


