Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C++
Different value of same pointer variable.
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Dan Cernat, post: 2515728"] 4088 - 3688 = 400 which is 200 *2 200 as in q = p + 200 2 as in sizeof(int) == 2 learn your pointer arithmetic! apparently the pointer size on your platform is 4 bytes and int size is 2. when you cast to int you truncate the value of the pointers: 0x8ffb0e68 -> 0x0e68 which is the decimal 3688 same goes for q. HTH /dan [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C++
Different value of same pointer variable.
Top