Suppose I have the global variables:
char *min_ptr, *max_ptr;
and the function:
void f(int *p)
{
if(min_ptr > p)
min_ptr = p;
if(max_ptr < p)
max_ptr = p;
}
If C does not guarantee that addresses are stored the same way as unsigned long, I guess I can't initialize my variables as follows:
char *min_ptr = ULONG_MAX, *max_ptr = 0;
How can I initialize min_ptr and max_ptr to the smallest and largest addresses respectively? And is it even valid to use the <, >, <=, or >= operators with pointers?