Click here to Skip to main content
15,899,025 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: big problem in mfc [modified] Pin
p_6-Jun-06 22:20
p_6-Jun-06 22:20 
GeneralRe: big problem in mfc [modified] Pin
Laxman Auti6-Jun-06 22:35
Laxman Auti6-Jun-06 22:35 
Questionpointers to an array and array of pointers Pin
Laxman Auti6-Jun-06 20:05
Laxman Auti6-Jun-06 20:05 
AnswerRe: pointers to an array and array of pointers [modified] Pin
_AnsHUMAN_ 6-Jun-06 20:21
_AnsHUMAN_ 6-Jun-06 20:21 
GeneralRe: pointers to an array and array of pointers [modified] Pin
Laxman Auti6-Jun-06 20:27
Laxman Auti6-Jun-06 20:27 
GeneralRe: pointers to an array and array of pointers [modified] Pin
Hamid_RT6-Jun-06 21:03
Hamid_RT6-Jun-06 21:03 
AnswerRe: pointers to an array and array of pointers Pin
yang__lee6-Jun-06 20:48
yang__lee6-Jun-06 20:48 
AnswerRe: pointers to an array and array of pointers Pin
Viorel.6-Jun-06 21:29
Viorel.6-Jun-06 21:29 
Since in operator precedence the "[]" operator has a priority above the "*" operator, the expression "int *p[10]" denotes an array of ten pointers, each pointing to an integer. In "int (*p)[10]" the order of interpretation was changed, and here we have a pointer to an array of ten integers.

In the first case, the size of p is 40 bytes (in our compiler), in the second case, the size is 4 bytes.

In the first case, you can assign new value for each array element like this:

p[2] = &z;
p[7] = new int;

Expression like *p[2] here can be used to change the value of z:

*p[2] = 100;

In the second case, you first have to allocate an array and assign its address to the pointer:

p = (int (*)[10]) new int [10];

Now you can access elements from this array:

(*p)[3] = 100;
(*p)[5] = 200;

Then you can delete the array:

delete [] p;

GeneralRe: pointers to an array and array of pointers Pin
Laxman Auti6-Jun-06 23:35
Laxman Auti6-Jun-06 23:35 
GeneralRe: pointers to an array and array of pointers Pin
Viorel.7-Jun-06 0:19
Viorel.7-Jun-06 0:19 
GeneralRe: pointers to an array and array of pointers Pin
Laxman Auti7-Jun-06 0:31
Laxman Auti7-Jun-06 0:31 
GeneralRe: pointers to an array and array of pointers Pin
Viorel.7-Jun-06 1:18
Viorel.7-Jun-06 1:18 
AnswerRe: Google Login [modified] Pin
Laxman Auti6-Jun-06 20:00
Laxman Auti6-Jun-06 20:00 
GeneralRe: Google Login [modified] Pin
Rahul.RK6-Jun-06 20:10
Rahul.RK6-Jun-06 20:10 
GeneralRe: Google Login [modified] Pin
Laxman Auti6-Jun-06 20:20
Laxman Auti6-Jun-06 20:20 
GeneralRe: Google Login [modified] Pin
Rahul.RK6-Jun-06 20:23
Rahul.RK6-Jun-06 20:23 
QuestionHow to display 2 sheets in Excel Pin
MikeRT6-Jun-06 19:25
MikeRT6-Jun-06 19:25 
AnswerRe: How to display 2 sheets in Excel Pin
FarPointer6-Jun-06 19:48
FarPointer6-Jun-06 19:48 
GeneralRe: How to display 2 sheets in Excel Pin
MikeRT6-Jun-06 20:02
MikeRT6-Jun-06 20:02 
GeneralRe: How to display 2 sheets in Excel Pin
FarPointer6-Jun-06 20:12
FarPointer6-Jun-06 20:12 
GeneralRe: How to display 2 sheets in Excel Pin
MikeRT6-Jun-06 20:36
MikeRT6-Jun-06 20:36 
QuestionText file stream? Pin
supernalle6-Jun-06 19:16
supernalle6-Jun-06 19:16 
Questionask for suggestion Pin
cheng_guo6-Jun-06 19:00
cheng_guo6-Jun-06 19:00 
AnswerRe: ask for suggestion Pin
_AnsHUMAN_ 6-Jun-06 19:11
_AnsHUMAN_ 6-Jun-06 19:11 
GeneralRe: ask for suggestion Pin
cheng_guo7-Jun-06 5:24
cheng_guo7-Jun-06 5:24 

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.