От: | N. I. | ||
Дата: | 21.02.17 16:44 | ||
Оценка: | 8 (1) |
The implementation shall define char to have the same range, representation, and behavior as either signed char or unsigned char. [Footnote: CHAR_MIN, defined in <limits.h>, will have one of the values 0 or SCHAR_MIN, and this can be used to distinguish the two options. Irrespective of the choice made, char is a separate type from the other two and is not compatible with either.]
ptrdiff_t char_ptr_diff(char *p1, signed char *p2)
{
return p1 - p2;
}
ptrdiff_t char_ptr_diff(char *p1, unsigned char *p2)
{
return p1 - p2;
}