NAME

vscanf, vsscanf, vfscanf - convert formatted input

SYNOPSIS

#include <stdio.h>

int vscanf (const char *format, __va_list);
int vsscanf (const char * s, const char *format, __va_list);
int vfscanf (FILE * strm, const char *format, __va_list);

DESCRIPTION

The functions vscanf(), vfscanf(), and vsscanf() are functionally equivalent to scanf() , fscanf(), and sscanf(), respectively, except that the argument list has been replaced by a pointer to a list of arguments. This pointer must be of type va_list, which is defined in the <stdarg.h> header

vscanf() reads from the standard input stream, stdin.

vfscanf() reads from the stream strm.

vsscanf() reads from the character string s.

RETURN VALUES

Refer to fscanf().

ERRORS

Refer to fscanf().

EXAMPLES

#include<stdio.h>
#include<stdarg.h>

void get_message(char *format, ...)
{
va_list ptr;
va_start(ptr, format);
vscanf(format, ptr);
va_end(ptr);
}

int main(void)
{
int i;
printf("integer:");
get_message(" %d ", &i);
printf("%d",i);
return 0;
}

SEE ALSO

fscanf()


< Copyright Rowebots Research Inc. and Multiprocessor Toolsmiths Inc. 1987-2011 >