TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: FRANK MASINGILL
from: CAMERON CLARK
date: 1997-08-05 18:58:00
subject: Re: Ascertaining address of a char

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)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.