When I search man of memccpy, I get the format of the function like this
void *memccpy(void *dest, const void *src, int c, size_t n)
I understand that integer c is used as unsigned char by type casting.
Then I think
void *memccpy(void *dest, const void *src, unsigned char c, size_t n)
looks better. Is there any reason memccpy must use int intparameter?
>Solution :
In ancient C, there was no way to pass an argument as an unsigned char; all arguments were promoted to at least int. Changing the parameter type to unsigned char now would break compatibility. (That could possibly be worked around, but there is no demand for it.)