1
我有這樣的代碼,SCANF行爲讀取時焦炭
int firstNum;
int secondNum;
char operator;
NSLog(@"Please enter the first number");
scanf("%i", &firstNum);
NSLog(@"Please enter the operator"); //Line 3
scanf("%c", &operator);
NSLog(@"Please enter the second number");
scanf("%i", &secondNum);
當我運行它,系統到達3號線,它不會等待用戶輸入一個字符值,而是立即執行下一行。怎麼了?