|int vscanf(const char * restrict format,|
format -This parameter will represent the entry point of the second argument and it also consists of conversion specifier.
arg -Stores the variable to which the data is to be written.
int-Returns the value of the macro EOF if an input failure occurs before any conversion.Otherwise, the vfscanf function returns the number of input items assigned,which can be fewer than provided for,or even zero, in the event of an early matching failure.
In C programming the <stdio.h> vscanf function is equivalent to scanf function but instead of using ellipsis as the second argument it is replaced by va_list macro (found in <stdarg.h> header ).A code example is given below.
Link : C scanf stdio.h
va_list arg ;
va_start(arg , format);
printf(“Enter any string:”);
ret=vscanf(format , arg);
printf(“\nret=%d” , ret);
va_end( arg );
int main( )
func( “%s” , str);
printf(“\nstr=%s” , str);
return 0 ;
Enter any string:Any string
As you can see calling ‘vscanf’ is same as calling ‘scanf’ except the variable to which the inputted data is to be written is stored in va_list.