Im not preety sure what do they mean with "Suppresses assignment. The conversion that follows occurs as usual, but no pointer is used; the result of the conversion is simply discarded.".
I mean what should i do in the following code below; when suppression is turned on? Should i just getchar() the next input field?
If the next input field is a valid one for the called scanf, just ignore it if suppression is turned on?
Code:
int minscanf(char *fmt, ...)
{
va_list ap;
char *p;
int suppression;
int field;
union {
int ival;
short int sival;
} val;
va_start(ap, fmt);
for(p = fmt; *p; p++) {
while(*p == ' ' || *p == '\t')
p++;
if(*p == '\0')
break;
suppression = field = 0;
if(*p == '%') {
if(*++p == '\0')
break;
if(*p == '*') {
suppression = 1;
if(*++p == '\0')
break;
}
while(isdigit(*p) && *p)
field = field * 10 + *p++ - '0';
}
if(suppression) {
}
}
}