Hi Everybody,
Glynn has asked me how I would compare two pointers if I could replace
"strcmp() == 0" with a relational equal sign. Suppose a pointer is only
an address. Then could I write, "if (&s1 = &s2) . . ."? Or would that
compare the address of s1's first character to the address of s2's
first character?
Maybe I could create a standard function named "pointer_of." For C
programmers, that may be a little wordy. But with it, I could say:
if (pointer_of(s1) = pointer_of(s2))
puts ("The addresses are the same.");
Glynn also said that we sometimes we need to pay attention to details.
That's true, of course, but the details hide in black boxes. If I want
to change the details, I'll change the contents of the boxes.
Best wishes,
Bill