Click here to Skip to main content
15,922,650 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionpatience sort project Pin
Member 109981454-Nov-14 5:42
Member 109981454-Nov-14 5:42 
AnswerRe: patience sort project Pin
Richard MacCutchan4-Nov-14 5:44
mveRichard MacCutchan4-Nov-14 5:44 
AnswerRe: patience sort project Pin
jeron14-Nov-14 5:45
jeron14-Nov-14 5:45 
GeneralRe: patience sort project Pin
PIEBALDconsult4-Nov-14 6:22
mvePIEBALDconsult4-Nov-14 6:22 
GeneralRe: patience sort project Pin
ZurdoDev4-Nov-14 6:24
professionalZurdoDev4-Nov-14 6:24 
GeneralRe: patience sort project Pin
PIEBALDconsult4-Nov-14 6:26
mvePIEBALDconsult4-Nov-14 6:26 
GeneralRe: patience sort project Pin
Snorri Kristjansson10-Nov-14 22:35
professionalSnorri Kristjansson10-Nov-14 22:35 
QuestionIAccessible, enable/disable, ... Pin
Castorix3-Nov-14 4:15
Castorix3-Nov-14 4:15 
SuggestionRe: IAccessible, enable/disable, ... Pin
Albert Holguin4-Nov-14 5:01
professionalAlbert Holguin4-Nov-14 5:01 
GeneralRe: IAccessible, enable/disable, ... Pin
Castorix4-Nov-14 6:45
Castorix4-Nov-14 6:45 
GeneralRe: IAccessible, enable/disable, ... Pin
Albert Holguin4-Nov-14 7:46
professionalAlbert Holguin4-Nov-14 7:46 
GeneralRe: IAccessible, enable/disable, ... Pin
Castorix4-Nov-14 22:30
Castorix4-Nov-14 22:30 
GeneralRe: IAccessible, enable/disable, ... Pin
Albert Holguin5-Nov-14 4:34
professionalAlbert Holguin5-Nov-14 4:34 
QuestionStatic linking Pin
Member 112017882-Nov-14 22:27
Member 112017882-Nov-14 22:27 
AnswerRe: Static linking Pin
Garth J Lancaster2-Nov-14 22:37
professionalGarth J Lancaster2-Nov-14 22:37 
AnswerRe: Static linking Pin
Richard MacCutchan2-Nov-14 23:09
mveRichard MacCutchan2-Nov-14 23:09 
AnswerRe: Static linking Pin
Albert Holguin3-Nov-14 11:31
professionalAlbert Holguin3-Nov-14 11:31 
GeneralRe: Static linking Pin
Member 112017883-Nov-14 23:31
Member 112017883-Nov-14 23:31 
AnswerRe: Static linking Pin
Albert Holguin4-Nov-14 4:24
professionalAlbert Holguin4-Nov-14 4:24 
QuestionTemplate Class Pointer - Would like explanation for unexpected behavior Pin
Foothill2-Nov-14 8:01
professionalFoothill2-Nov-14 8:01 
AnswerRe: Template Class Pointer - Would like explanation for unexpected behavior Pin
Richard MacCutchan2-Nov-14 8:13
mveRichard MacCutchan2-Nov-14 8:13 
GeneralRe: Template Class Pointer - Would like explanation for unexpected behavior Pin
Foothill2-Nov-14 8:44
professionalFoothill2-Nov-14 8:44 
AnswerRe: Template Class Pointer - Would like explanation for unexpected behavior Pin
Freak303-Nov-14 2:50
Freak303-Nov-14 2:50 
The reason for the different behvior is that you can only override the accessor [] for an instance or reference but not for a pointer. Using [] on a pointer is always interpreted as pointer + index by the compiler. So the compiler thinks you have an array of Array.

The usual syntax around this is
C++
printf("%d\n", (*iArrayB)[i]);

This makes clear that iArrayB isn't an array but a pointer to a single object, and that you want to call the operator for the object it points to.
The good thing about pessimism is, that you are always either right or pleasently surprised.

GeneralRe: Template Class Pointer - Would like explanation for unexpected behavior Pin
Foothill3-Nov-14 5:59
professionalFoothill3-Nov-14 5:59 
GeneralRe: Template Class Pointer - Would like explanation for unexpected behavior Pin
the_foobar3-Dec-14 20:26
the_foobar3-Dec-14 20:26 

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.