Hi,
given the following code:
/* signatures */
int getParams(char params[MAX_PARAM_LEN][MAX_LINE_LEN]);
int getVersion(const char params[MAX_PARAM_LEN][MAX_LINE_LEN],
const char* tagName );
/* initializing */
char params[MAX_PARAM_LEN][MAX_LINE_LEN] = {};
/* getting parameters */
paramCount = getParams(params); /* OK, params match with getParams signature */
/* processing the params array */
i = getVersion(params, "version"); /* warning: passing arg 1 of `getVersion' from incompatible pointer type */
I see that the constness is the problem, but I don't know why or how to avoid it. What I want is a function which can't modify the params
anymore. Any advice is welcome(besides disabling this warning or deleting const in the processing function).
Thanks: Visko