0

What is %*c in scanf("%d%*c",t);? #include <stdio.h> int main(void) { int t; scanf("%d%*c", &t); printf("%d",t);

What does %*c mean?

9th Mar 2020, 11:14 PM
PGS ADI
PGS ADI - avatar
2 Answers
+ 4
"%*c" stands for assignment-suppressing character: If this option is present, the scanf does not assign the result of the conversion to any receiving argument. the character will be read but not assigned to any variable. for example for the input "45r" it will assign 45 to "t", but "r" will be ignored.
10th Mar 2020, 12:06 AM
MO ELomari
MO ELomari - avatar
+ 2
Thanks for your help.
10th Mar 2020, 8:27 AM
PGS ADI
PGS ADI - avatar