tfVSScanF

Jump to: navigation, search

Table of Contents >> Programmer's Reference


#include <trsocket.h>


int tfVSScanF (
const char TM_FAR * buf0,
const char TM_FAR * fmt0,
va_list ap
);


Function Description

This function is used to parse a string. It is similar to tfSScanF() except that it takes a va_list structure as its third parameter rather than a variable length list of arguments.


Format Specifiers:

Code Description
%c Read a character. White space characters are not read unless %c is used
%d Read a decimal number
%e Read a floating-point number. It can have a + or - sign. It can also be a series of digits with a decimal point and an exponent (e or E) followed by a signed or unsigned integer
%f Read a floating-point number. It can have a + or - sign. It can also be a series of digits with a decimal point and an exponent (e or E) followed by a signed or unsigned integer
%g Read a floating-point number. It can have a + or - sign. It can also be a series of digits with a decimal point and an exponent (e or E) followed by a signed or unsigned integer
%i Read a decimal integer
%n Use an integer number to express the number of bytes successfully read
%o Read an octal number
%p Read a pointer (platform specific)
%s Read a string
%u Read an unsigned decimal integer
%x Read a hexidecmal number
%[] Read a set of characters


Parameters

  • buf0
    The string to be parsed.
  • fmt0
    The string containing the format specifiers dictating which type of data is to be read.
  • ap
    A va_list structure containing the variables referred to by the format specifiers.


Returns

  • int
    The number of input fields that were both formatted and assigned a value.
  • EOF
    Failure.


Table of Contents >> Programmer's Reference