FM> I suppose this is a stupid question since I can't find the
FM> answer in a number of good teaching books I have.
FM>
FM> How does one get a program to get the ADDRESS of a char? I
FM> can do it readily with an int. If I assign char x - 'A' thought and
FM> do a cout << &x I get an A followed by one of the early chars.
FM>
FM> What am I missing here?
char x;
cout << (pointer)&x; // ????
Note that "char*" is treated as a string in the language. If you
cast the address of the character, it's no longer treated as a string.
--- GEcho 1.00
---------------
* Origin: Digital OnLine Magazine! - (409)838-8237 (1:3811/350)
|