Click here to Skip to main content
15,889,116 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: explicit keyword Pin
Nelek10-Dec-07 23:27
protectorNelek10-Dec-07 23:27 
Questionhow to use MFC data Types in win 32 dll Pin
kmani_soft10-Dec-07 18:57
kmani_soft10-Dec-07 18:57 
AnswerRe: how to use MFC data Types in win 32 dll Pin
CPallini10-Dec-07 22:37
mveCPallini10-Dec-07 22:37 
AnswerRe: how to use MFC data Types in win 32 dll Pin
Mark Salsbery11-Dec-07 6:23
Mark Salsbery11-Dec-07 6:23 
Generalstring array v.s. int array Pin
George_George10-Dec-07 18:51
George_George10-Dec-07 18:51 
GeneralRe: string array v.s. int array Pin
Doc Lobster10-Dec-07 22:10
Doc Lobster10-Dec-07 22:10 
GeneralRe: string array v.s. int array Pin
George_George10-Dec-07 22:33
George_George10-Dec-07 22:33 
GeneralRe: string array v.s. int array Pin
CPallini10-Dec-07 22:21
mveCPallini10-Dec-07 22:21 
The depicted behavior is not so strange...

George_George wrote:
1. For string array, dereferencing it will result in the string itself, but for int array, dereferencing it will result in the address of the array;

In fact the behavior is quite similar: the name (or the address-of operator & applied on the name, remembering past posts... Smile | :) ) of the int array returns the address of the memory containing the integer values as well the name of the character array returns the address of the memory containing the character values;
you find a noticeable difference in the output only because a (C-like) string is nothing more than the pointer to the memory holding the zero-terminated character sequence, hence whenever wcout finds a (wide) character pointer, it prints the characters belonging to the pointed memory.

George_George wrote:
When dereferencing it twice (operator **), why the result is always the 1st element in both string array sample and int array sample?


Again, nothing strange here. Given a int pointer, say int *p, deferencing it means: "take the content of the pointed memory", namely the integer value at address p (that coincide with the first int element of the array). The same point applies to the character array.

Smile | :)






Smile | :)

If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.


GeneralRe: string array v.s. int array Pin
George_George10-Dec-07 22:40
George_George10-Dec-07 22:40 
GeneralRe: string array v.s. int array [modified] Pin
CPallini10-Dec-07 22:51
mveCPallini10-Dec-07 22:51 
GeneralRe: string array v.s. int array Pin
George_George10-Dec-07 23:15
George_George10-Dec-07 23:15 
GeneralRe: string array v.s. int array Pin
CPallini10-Dec-07 23:41
mveCPallini10-Dec-07 23:41 
GeneralRe: string array v.s. int array Pin
George_George11-Dec-07 1:54
George_George11-Dec-07 1:54 
GeneralRe: string array v.s. int array Pin
CPallini11-Dec-07 2:11
mveCPallini11-Dec-07 2:11 
GeneralRe: string array v.s. int array Pin
Iain Clarke, Warrior Programmer11-Dec-07 6:08
Iain Clarke, Warrior Programmer11-Dec-07 6:08 
GeneralRe: string array v.s. int array Pin
George_George11-Dec-07 21:14
George_George11-Dec-07 21:14 
GeneralWM_CTLCOLOR Pin
Tara1410-Dec-07 17:42
Tara1410-Dec-07 17:42 
GeneralRe: WM_CTLCOLOR Pin
Naveen10-Dec-07 18:22
Naveen10-Dec-07 18:22 
GeneralCursor color in resource editor Pin
followait10-Dec-07 16:23
followait10-Dec-07 16:23 
GeneralRe: Cursor color in resource editor Pin
Nelek10-Dec-07 23:23
protectorNelek10-Dec-07 23:23 
GeneralRe: Cursor color in resource editor Pin
followait11-Dec-07 3:47
followait11-Dec-07 3:47 
GeneralRe: Cursor color in resource editor Pin
Nelek11-Dec-07 22:32
protectorNelek11-Dec-07 22:32 
GeneralRe: Cursor color in resource editor Pin
followait11-Dec-07 23:02
followait11-Dec-07 23:02 
QuestionIs floating point number mathematical integer? Pin
Oliver12310-Dec-07 14:15
Oliver12310-Dec-07 14:15 
AnswerRe: Is floating point number mathematical integer? Pin
followait10-Dec-07 16:38
followait10-Dec-07 16:38 

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.