Click here to Skip to main content
15,844,152 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Question[Solved] Passing an element from a list [modified] Pin
crgmustang13-Jul-11 14:50
crgmustang13-Jul-11 14:50 
AnswerRe: Passing an element from a list Pin
«_Superman_»13-Jul-11 15:48
professional«_Superman_»13-Jul-11 15:48 
GeneralRe: Passing an element from a list Pin
crgmustang14-Jul-11 6:28
crgmustang14-Jul-11 6:28 
QuestionPointer Maths Pin
KeithF12-Jul-11 4:25
KeithF12-Jul-11 4:25 
AnswerRe: Pointer Maths [modified] Pin
Stefan_Lang12-Jul-11 4:52
Stefan_Lang12-Jul-11 4:52 
GeneralRe: Pointer Maths Pin
Legor12-Jul-11 5:02
Legor12-Jul-11 5:02 
GeneralRe: Pointer Maths Pin
Stefan_Lang12-Jul-11 5:16
Stefan_Lang12-Jul-11 5:16 
AnswerRe: Pointer Maths Pin
Legor12-Jul-11 4:55
Legor12-Jul-11 4:55 
When using sizeof with a structure it is not guaranteed that you get the sum of the single components due to Structure padding (wiki for it). Just printf the sizeof() of your struct and you will see that its not 12 Bytes.

Anyway it is very unclear to me why are you even trying to do it this way. Dont mess with addresses and pointers in such an unsafe way. Who even tells you that you could just decrease the given int pointer and it would still point to a valid adress.

E.g. just use the indices of the array to get the last element.
GeneralRe: Pointer Maths Pin
Rick York13-Jul-11 19:39
mveRick York13-Jul-11 19:39 
GeneralRe: Pointer Maths Pin
Legor17-Jul-11 1:39
Legor17-Jul-11 1:39 
GeneralRe: Pointer Maths Pin
enhzflep13-Jul-11 20:14
enhzflep13-Jul-11 20:14 
GeneralRe: Pointer Maths Pin
Richard MacCutchan13-Jul-11 22:53
mveRichard MacCutchan13-Jul-11 22:53 
QuestionHow to do 2 or more process simultaneously? Pin
Le@rner12-Jul-11 3:21
Le@rner12-Jul-11 3:21 
QuestionRe: How to do 2 or more process simultaneously? Pin
CPallini12-Jul-11 4:02
mveCPallini12-Jul-11 4:02 
AnswerRe: How to do 2 or more process simultaneously? Pin
Le@rner12-Jul-11 19:26
Le@rner12-Jul-11 19:26 
GeneralRe: How to do 2 or more process simultaneously? [fixed] Pin
CPallini12-Jul-11 22:09
mveCPallini12-Jul-11 22:09 
GeneralRe: How to do 2 or more process simultaneously? Pin
Le@rner12-Jul-11 22:16
Le@rner12-Jul-11 22:16 
GeneralRe: How to do 2 or more process simultaneously? Pin
CPallini12-Jul-11 22:24
mveCPallini12-Jul-11 22:24 
AnswerRe: How to do 2 or more process simultaneously? Pin
Albert Holguin12-Jul-11 5:56
professionalAlbert Holguin12-Jul-11 5:56 
AnswerRe: How to do 2 or more process simultaneously? Pin
jschell12-Jul-11 11:21
jschell12-Jul-11 11:21 
GeneralRe: How to do 2 or more process simultaneously? Pin
Le@rner12-Jul-11 20:54
Le@rner12-Jul-11 20:54 
GeneralRe: How to do 2 or more process simultaneously? Pin
Chris Walters13-Jul-11 7:24
Chris Walters13-Jul-11 7:24 
AnswerRe: How to do 2 or more process simultaneously? Pin
Eugen Podsypalnikov12-Jul-11 23:18
Eugen Podsypalnikov12-Jul-11 23:18 
GeneralRe: How to do 2 or more process simultaneously? Pin
Le@rner15-Jul-11 22:57
Le@rner15-Jul-11 22:57 
QuestionHow to set the multi selection property of a list box as TRUE through the code Pin
Amrit Agr12-Jul-11 1:34
Amrit Agr12-Jul-11 1:34 

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.