C Tutorial/printf scanf/scanf star — различия между версиями
Admin (обсуждение | вклад) м (1 версия: Импорт контента...) |
Admin (обсуждение | вклад) м (1 версия: Импорт контента...) |
(нет различий)
|
Текущая версия на 13:32, 25 мая 2010
scanf: skip the integer between the two strings
<source lang="cpp">#include <stdio.h>
int main(void) { char str[80], str2[80]; int i; printf("skip the integer between the two strings:"); scanf("%s%*d%s", str, str2); return 0; }</source>
Use *
The * is used to suppress input.
<source lang="cpp">scanf(" %d %*d %*d%*d %d ", &i, &j)</source>
If your input is 10 20 30 40 50, i will get the value 10 and j will get the value 50.