tfSScanF
Table of Contents >> Programmer's Reference
#include <trsocket.h> |
int tfSScanF | ( |
char * buffer, | |
const char * format, | |
... | |
); |
Function Description
This function is used to parse a string; it reads data from buffer into locations designated by arguments provided by the user.
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
- buffer
- The string to be parsed.
- format
- The string containing the format specifiers dictating which type of data is to be read.
Returns
- int
- The number of input fields that were both formatted and assigned a value.
- End of File (EOF)
- Failure