-=> Quoting Neil Heller to All
NH> Given the following code:
NH> char aStr[10] = "abcdefgh";
NH> char * aPtr = &aStr[5];
NH> cout << aPtr << endl;
NH> The output is garbage. How does one correct print the value of a
NH> pointer?
The output shouldn't be garbage - it should be "fgh"!
That it isn't what you _want_ to output isn't an issue - it isn't garbage,
just not the desired output.
You want:
cout << (void*)aPtr << endl;
... "You cannot change a person with your fists . . ." -Bruce Lee
--- FastEcho 1.46
---------------
* Origin: House of Fire BBS - Toronto - (416)601-0085 - v.34 (1:250/536)
|