static int (*retrivalFunc)(char *attr, char *option, returnCode *codePtr,char *buf) = NULL; sampleFunc() { if (attRetrivalfunc != NULL) { return(retrivalFunc(attName, dataBuf,codePtr, msg)); } }
Look closely: you're not testing for retrivalFunc == NULL at all. Segher