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

c question

P: 1
hi this is vijay i have one doubt in c, can any one clear it

there is 2 address locations 0x1000 & 0x2000, these addresses are assigned to p&q.
in that address we want to place 2&3 values , after that we want to swap both address also values. how this is possible in c program.

Also in c how we can assign the hexa value to a variable.

Answer can send to <email removed>
Aug 10 '07 #1
Share this Question
Share on Google+
3 Replies


hariharanmca
100+
P: 1,977
hi this is vijay i have one doubt in c, can any one clear it

there is 2 address locations 0x1000 & 0x2000, these addresses are assigned to p&q.
in that address we want to place 2&3 values , after that we want to swap both address also values. how this is possible in c program.

Also in c how we can assign the hexa value to a variable.

Answer can send to [email removed]
wellcom To TSDN

and you should not post any E-mail id or phone number.




Good luck
Aug 10 '07 #2

kestrel
Expert 100+
P: 1,071
hi this is vijay i have one doubt in c, can any one clear it

there is 2 address locations 0x1000 & 0x2000, these addresses are assigned to p&q.
in that address we want to place 2&3 values , after that we want to swap both address also values. how this is possible in c program.

Also in c how we can assign the hexa value to a variable.

Answer can send to <email removed>
Hey samvinny, Im going to move this question to the C/C++ Forum, you will get the help you need there.
Furthermore, please do not post personal information such as phone numbers or email addresses. I have removed the email address from your post. Have a nice day!

--
Kestrel
Aug 10 '07 #3

Expert 10K+
P: 11,448
hi this is vijay i have one doubt in c, can any one clear it

there is 2 address locations 0x1000 & 0x2000, these addresses are assigned to p&q.
in that address we want to place 2&3 values , after that we want to swap both address also values. how this is possible in c program.

Also in c how we can assign the hexa value to a variable.
Last question first: a value is a value is a value; the hexadecimal notation is just
a representation for a value. 0xff (hex), 255 (dec) 0377 (oct) all represent the same
value.
So if you can assign a value in one representation you can assign that same value
in one of the other available representations.

First question last: you can change memory content but you cannot change the
address of memory itself. So you can swap the values 2 and 3 in your example
so that the value 2 ends up in memory location 0x2000 and 3 ends up in memory
location 0x1000, but there is no way you can alter the addresses of those memory
locations. That's how memory works ...

kind regards,

Jos
Aug 10 '07 #4

Post your reply

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