MemCom Reference Manual > MemCom C API Manual Pages > Utility Functions > mcStringDecomp

Name

mcStringDecomp — Decompose fields of string

Synopsis

#include <memcom.h>

char** mcStringDecomp(const char* field, int* nfields);

Description

mcStringDecomp decomposes a composite field of the form a.b.c.d into separate fields. If completed successfully, the function creates an array of strings and returns a pointer to the array and the number of fields. If not it returns NULL. Note that both the array of string pointers and each of the strings has to be release with free by the user!

Parameters

field

Character string to be decomposed (input).

nfields

Number of fields found (output). The value will be at least 1.