dc_tosingle()

Converts a string in a field to a single-precision floating point variable

Call
#include <vv_singl.h>
int dc_tosingle(stp, datap, dfldp, cvbufp)

UCHAR *stp

Pointer to string with user's field input

PTR datap Pointer to variable to receive converted field input
DFIELDPTR dfldp Pointer to a data field structure
PTR cvbufp Pointer to a data conversion buffer
Returns  
1 Success. This is the only return value for this function
Description

dc_tosingle() makes a copy of the field string in the conversion buffer. All embedded blanks and thousands separators are deleted from the buffer, and the resulting string is converted to a single-precision floating point value. The single-precision floating point value is placed in the data variable.

Related Functions

dc_frsingle(), vf_single()

Cautions

No error checking is performed on the input string. The function assumes that vf_single() has already validated the string.

This function calls atof(). You may have to link the appropriate floating point library for your compiler to resolve atof().


Home Contents Previous Next