ATOVAL C-3

NAME

atoval - convert ASCII string to value

SYNOPSIS

#include <cbase/dtypes.h>

atoval (buf, str, type, size)

char *buf;

char *str;

int type;

int size;

DESCRIPTION

This function converts a string pointed to by str to its binary form. The binary value is stored in buf. The type parameter names the data type of the character string and is one of the data types named in the include file. The size parameter gives the size in bytes of the binary field that will contain the value. The sizeof() function should be used to determine this value.

EXAMPLES

DATE datefld;

short count;

MONEY amount;

long links;

atoval (&datefld, "02/15/84", DATE_TYPE, sizeof(datefld));

atoval (&count, "23", INT_TYPE, sizeof(count));

atoval (&links, "234945", INT_TYPE, sizeof(links));

atoval (&amount, "68,567.95", MONEY_TYPE, sizeof(amount));

SEE ALSO

atobool(C-3), atodate(C-3), atolong(C-3)

atomoney(C-3), atoreal(C-3), atotime(C-3)

C/Base Reference Manual Chapter 13, "Formatting Data Values"