在 C 语言中,使用带有参数的 scanf()
时,scanf("%d %*d", &a, &b)
的行为有所不同。它只输入一个变量的值,而不是两个!
Please explain this!
scanf("%d %*d", &a, &b);
最佳答案
*
基本上意味着忽略说明符(读取整数,但不赋值)。
引自man scanf :
* Suppresses assignment. The conversion that follows occurs as usual, but no pointer is used; the result of the conversion is simply discarded.
关于c - scanf() 跳过变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39710316/