How can I add the 10 digit number without write one digit in each line.
struct test {
unsigned short telephone[10];
//Some Code Here ...
}
for (j = 0; j < 10; j++) {
scanf("%d", & seats[position - 1].telephone[j]);
}
How can I add the 10 digit number without write one digit in each line.
struct test {
unsigned short telephone[10];
//Some Code Here ...
}
for (j = 0; j < 10; j++) {
scanf("%d", & seats[position - 1].telephone[j]);
}
Two things to mention,
Write
which reads only 1 element from the input .
Note: the
h
is a length modifiers , which is described asAlso related, from
C11
, chapter ยง7.21.6.2/p9, (emphasis mine)