Adding a Function Prototype
Begin by adding a function prototype to the function declaration list:
static void max CC_ARGS((int, double * >= maxlen) break; /* don't exceed maxlen */
if (isalnum(*ptr)) {
if (flag) *p = islower(*ptr)?toupper(*ptr):*ptr;
else *p = isupper(*ptr)?tolower(*ptr):*ptr;
flag = 0;
} else {
flag = 1;
*p = *ptr;
}
p++; ptr++;
}
*p = '\0';
return;
}Note the use of the CC_ARGL, CC_ARG, and CC_LARG macros. You can also write the code as follows (only the first five lines are shown):
static void initcap(argc,argv,result,maxlen)
int argc; /* Number of actual arguments */
char* argv[]; /* Pointers to arguments: */
char* result; /* Where to store result */
int maxlen; /* Result's maximum length */