Click here to Skip to main content
15,891,692 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Type Conversion [modified] Pin
satsumatable26-May-06 17:01
satsumatable26-May-06 17:01 
GeneralRe: Type Conversion [modified] Pin
Stephen Hewitt26-May-06 17:46
Stephen Hewitt26-May-06 17:46 
Questionswap Red and Blue in GDI+ Pin
ilidan25-May-06 18:45
ilidan25-May-06 18:45 
AnswerRe: swap Red and Blue in GDI+ Pin
_anil_25-May-06 19:37
_anil_25-May-06 19:37 
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 
Hi everyone,

i dont have any experience in VC++.I know some C and C++, thats all.May be silly,but out of curiosity I am asking this question.
If we delare a pointer as

int * p ,it will create an integer pointer p.It will reserve 2 bytes in memory also.How this two memory locations and *p is tagged together or who is allocating these memory locations to p(Like,the rule p should hold only addresses).

say the locations are 1000 and 1001.

consider this, and please check my interpretations are correct or not;


int j;
*p=2; // integer 2 is stored in 1000 and 1001 as(0000 0010)
(will this work .here p does not hold any address value and storing value 2 directly in their address space)
printf("%d",p) //prints 1000

p=&j; // now doubt,here how 1000,1001 store the address of j
j=4; // *p and j will print the same value.



Please give your comments about this or please direct me if you know some good stuffs regarding the memory concepts in programming.

Thank you









-- modified at 0:55 Friday 26th May, 2006
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 
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 

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.