STRING ARRAY(3SP)

NAME
StrArray2IntArray, StrArray2FloatArray, IntArray2StrArray, FloatArray2StrArray, Str2StrArray, FreeStrArray - string array routines

SYNOPSIS

#include <speech.h>

int *StrArray2IntArray (char **sa, int len)

float *StrArray2FloatArray (char **sa, int len)

char **IntArray2StrArray (int *ia, int len)

char **FloatArray2StrArray (float *fa, int len)

char **Str2StrArray (char *str)

void FreeStrArray (char **sa, int len)

DESCRIPTION
These routines are used to convert between string, integer, and float arrays. The space for the new array is allocated using malloc (3). The allocated arrays should be freed with free (3) or FreeStrArray (3SP), whichever is appropiate. All of the string arrays are assumed to contain the proper ASCII represention of the numeric data.

StrArray2IntArray() returns a pointer to an integer array containing the converted values from sa. len is the length of the array sa.

StrArray2FloatArray() returns a pointer to a float array containing the converted values from sa. len is the length of the array sa.

IntArray2StrArray() returns a pointer to a string array which contains the ASCII representation of the integer array ia. len is the length of ia.

FloatArray2StrArray() returns a pointer to a string array which contains the ASCII representation of the float array fa. len is the length of fa.

Str2StrArray() returns a pointer to a string array of length one containing the string str.

FreeStrArray() is used to free the string arrays created by IntArray2StrArray(), FloatArray2StrArray(), and Str2StrArray()

EXAMPLES

DIAGNOSTICS

All of the routines (except FreeStrArray) return a NULL pointer on error an sets ErrorString(3SP).

SEE ALSO
ErrorString(3SP), malloc(3), free(3), string(3)

BUGS

AUTHOR
Center for Spoken Language Understanding
Department of Computer Science and Engineering
Oregon Graduate Institute of Science & Technology