By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,852 Members | 2,123 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,852 IT Pros & Developers. It's quick & easy.

please suggest me the corrrect answer.

P: 62
Hi can any one tell me

If we want to print the adress of the object if I type cast in to int on a machine where address and int occupies same size it is not be a problem.
If on a machine where adress and int are diffferent assume 64 bit machine
If we type cast it to (int *) before printing the address of the object will it give a wrong value.

please suggest me the corrrect answer.


Sep 20 '06 #1
Share this Question
Share on Google+
3 Replies

Expert Mod 5K+
P: 8,916
This is not about the object, there should not be any need to typecast it. This is about how you inform printf (or whatever function you are using) that it is a 64 bit value rather than a 32 bit value.

This is platform dependent.
Sep 20 '06 #2

P: 62
Thanks banfa
Sep 20 '06 #3

P: 144
On most modern Unix systems "unsigned long" is the underlying type used for 64bit safe pointer addresses.
Sep 20 '06 #4

Post your reply

Sign in to post your reply or Sign up for a free account.