> >They could, of course, just call ParamCStringValue() and then copy
> >the memory it points to, which would seem to eliminate the need for
> >the Copy... functions altogether.
I take it you think that the data will be a null terminated string. More
likely(to support binary data) you would have to do a copy anyway like:

int     myFlag;
unsigned int len = GetParamLength( param );
char *  paramPtr = (char *)malloc(len+1);
memcpy(paramptr,GetParamData(),len);
paramptr[len] = '\0';
myFlag = strcmp(paramPtr, "yes");
free(paramPtr);

If you need to access the data without copying you could  use strncmp
instead:
strncmp(GetParamData(), "yes", GetParamLength(param));

regards,
Tuviah

Reply via email to