S
System Administrator
I have a function
int match(struct regexp *regexp, char *string, char **tail)
which matches a string against a regular expression, and if it
succeeds sets *tail to be the unmatched tail of the string.
I'd like the string argument to be const char *, to document the fact
that the match function doesn't modify it, but then I can't assign the
tail without an explicit de-constifying cast.
Should I give up the idea of using const here?
-- Richard
int match(struct regexp *regexp, char *string, char **tail)
which matches a string against a regular expression, and if it
succeeds sets *tail to be the unmatched tail of the string.
I'd like the string argument to be const char *, to document the fact
that the match function doesn't modify it, but then I can't assign the
tail without an explicit de-constifying cast.
Should I give up the idea of using const here?
-- Richard