Click here to Skip to main content
15,898,893 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: swap Red and Blue in GDI+ Pin
ilidan25-May-06 19:50
ilidan25-May-06 19:50 
GeneralRe: swap Red and Blue in GDI+ Pin
_anil_25-May-06 20:01
_anil_25-May-06 20:01 
GeneralRe: swap Red and Blue in GDI+ Pin
ilidan25-May-06 20:14
ilidan25-May-06 20:14 
Questionpointer [modified] Pin
jith - iii25-May-06 18:45
jith - iii25-May-06 18:45 
AnswerRe: pointer Pin
PJ Arends25-May-06 18:59
professionalPJ Arends25-May-06 18:59 
AnswerRe: pointer Pin
S. Senthil Kumar25-May-06 19:04
S. Senthil Kumar25-May-06 19:04 
GeneralRe: pointer Pin
jith - iii25-May-06 19:22
jith - iii25-May-06 19:22 
GeneralRe: pointer Pin
S. Senthil Kumar25-May-06 19:52
S. Senthil Kumar25-May-06 19:52 
jithAtran - ii wrote:
the address of p is 1000/1001 and how it store the addresses 2000/2001 in bit format considering 1000 will hold 4 bits and 1001 will also hold 4 bits

Like I said in my previous post, the size of a pointer is dependent on the platform. And address is different from the size of a variable. On Win32, a pointer is 4 bytes. If the address of p is 1000, then bytes 1000, 1001, 1002 and 1003 will be available for p. 4 bytes is equal to 32 bits and 232 is the maximum address value you can point at.

Taking your example, assuming a 16 bit environment, then the address of p will be 1000 and it will have two bytes allocated to it, 1000 and 1001. A byte is 8 bits, so 1000 can store 8 bits and 1001 can store 8 bits, for a total of 16 bits. For storing 2000, depending on the endianness, the compiler might do
<pre>
_________________
__00___|___7D_____
1000        1001
</pre>
7D is 2000 expressed in hex.

Does this answer your question?


Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
GeneralRe: pointer [modified] Pin
jith - iii25-May-06 21:09
jith - iii25-May-06 21:09 
GeneralRe: pointer Pin
S. Senthil Kumar25-May-06 22:59
S. Senthil Kumar25-May-06 22:59 
GeneralRe: pointer [modified] Pin
jith - iii25-May-06 23:31
jith - iii25-May-06 23:31 
GeneralRe: pointer [modified] Pin
S. Senthil Kumar26-May-06 14:27
S. Senthil Kumar26-May-06 14:27 
GeneralRe: pointer [modified] Pin
jith - iii26-May-06 19:02
jith - iii26-May-06 19:02 
GeneralRe: pointer [modified] Pin
S. Senthil Kumar26-May-06 20:42
S. Senthil Kumar26-May-06 20:42 
GeneralRe: pointer [modified] Pin
jith - iii26-May-06 22:30
jith - iii26-May-06 22:30 
GeneralRe: pointer [modified] Pin
Stephen Hewitt26-May-06 18:05
Stephen Hewitt26-May-06 18:05 
GeneralRe: pointer [modified] Pin
S. Senthil Kumar26-May-06 20:35
S. Senthil Kumar26-May-06 20:35 
AnswerRe: pointer [modified] Pin
Member 303984325-May-06 19:29
Member 303984325-May-06 19:29 
AnswerRe: pointer [modified] Pin
Saday Sarkar25-May-06 19:51
Saday Sarkar25-May-06 19:51 
GeneralRe: pointer [modified] Pin
jith - iii25-May-06 21:11
jith - iii25-May-06 21:11 
GeneralRe: pointer [modified] Pin
Stephen Hewitt26-May-06 18:25
Stephen Hewitt26-May-06 18:25 
GeneralRe: pointer [modified] Pin
jith - iii26-May-06 19:06
jith - iii26-May-06 19:06 
QuestionLinux's gettimeofday() equivalent for windows Pin
useme12325-May-06 18:41
useme12325-May-06 18:41 
AnswerRe: Linux's gettimeofday() equivalent for windows Pin
Ganesh_T25-May-06 18:51
Ganesh_T25-May-06 18:51 
GeneralRe: Linux's gettimeofday() equivalent for windows Pin
ThatsAlok25-May-06 22:18
ThatsAlok25-May-06 22:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.