Click here to Skip to main content
15,912,400 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: OPENFILENAME question /*modified*/ Pin
Hamid_RT21-Jul-06 1:50
Hamid_RT21-Jul-06 1:50 
GeneralRe: OPENFILENAME question /*modified*/ Pin
toxcct21-Jul-06 2:35
toxcct21-Jul-06 2:35 
GeneralRe: OPENFILENAME question Pin
Hamid_RT21-Jul-06 3:53
Hamid_RT21-Jul-06 3:53 
AnswerRe: OPENFILENAME question Pin
David Crow21-Jul-06 3:08
David Crow21-Jul-06 3:08 
AnswerRe: OPENFILENAME question Pin
ThatsAlok21-Jul-06 3:11
ThatsAlok21-Jul-06 3:11 
AnswerRe: OPENFILENAME question Pin
Hamid_RT21-Jul-06 3:52
Hamid_RT21-Jul-06 3:52 
Question[SOLVED - see last post] Help needed: another strange calloc/malloc issue [modified] Pin
lyuabe21-Jul-06 0:30
lyuabe21-Jul-06 0:30 
AnswerRe: Help needed: another strange calloc/malloc issue Pin
Stephen Hewitt21-Jul-06 1:03
Stephen Hewitt21-Jul-06 1:03 
There is nothing wrong with this code. Are you sure one of the pointers isn't being changed after the allocation? To guard againt this try the following:
...
double * const a = (double * const)malloc(Na*sizeof(double));
double * const b = (double * const)malloc(Nb*sizeof(double));
double * const c = (double * const)malloc(Nc*sizeof(double));
...


This makes the pointer constant but not the data it actually points to. With this in place any code (almost) which attempts to change the address of the pointers will not compile.

const is the programmer's friend.

Steve
GeneralRe: Help needed: another strange calloc/malloc issue Pin
lyuabe21-Jul-06 1:14
lyuabe21-Jul-06 1:14 
GeneralRe: Help needed: another strange calloc/malloc issue Pin
Cedric Moonen21-Jul-06 1:16
Cedric Moonen21-Jul-06 1:16 
GeneralRe: Help needed: another strange calloc/malloc issue Pin
lyuabe21-Jul-06 1:24
lyuabe21-Jul-06 1:24 
QuestionRe: Help needed: another strange calloc/malloc issue Pin
David Crow21-Jul-06 3:12
David Crow21-Jul-06 3:12 
GeneralRe: Help needed: another strange calloc/malloc issue [modified] Pin
cmk21-Jul-06 4:33
cmk21-Jul-06 4:33 
GeneralRe: Help needed: another strange calloc/malloc issue Pin
lyuabe21-Jul-06 7:15
lyuabe21-Jul-06 7:15 
GeneralRe: Help needed: another strange calloc/malloc issue Pin
Stephen Hewitt21-Jul-06 1:16
Stephen Hewitt21-Jul-06 1:16 
GeneralRe: Help needed: another strange calloc/malloc issue Pin
lyuabe21-Jul-06 1:26
lyuabe21-Jul-06 1:26 
GeneralRe: Help needed: another strange calloc/malloc issue Pin
Stephen Hewitt21-Jul-06 2:51
Stephen Hewitt21-Jul-06 2:51 
AnswerRe: Help needed: another strange calloc/malloc issue Pin
Steve S21-Jul-06 1:03
Steve S21-Jul-06 1:03 
AnswerRe: Help needed: another strange calloc/malloc issue [modified] Pin
Jonas Hammarberg21-Jul-06 1:40
professionalJonas Hammarberg21-Jul-06 1:40 
GeneralRe: Help needed: another strange calloc/malloc issue Pin
lyuabe21-Jul-06 1:18
lyuabe21-Jul-06 1:18 
GeneralRe: Help needed: another strange calloc/malloc issue Pin
Stephen Hewitt21-Jul-06 3:05
Stephen Hewitt21-Jul-06 3:05 
GeneralRe: Help needed: another strange calloc/malloc issue Pin
lyuabe21-Jul-06 7:23
lyuabe21-Jul-06 7:23 
GeneralRe: Help needed: another strange calloc/malloc issue Pin
Stephen Hewitt21-Jul-06 18:56
Stephen Hewitt21-Jul-06 18:56 
GeneralRe: Help needed: another strange calloc/malloc issue Pin
lyuabe29-Jul-06 2:24
lyuabe29-Jul-06 2:24 
GeneralRe: Help needed: another strange calloc/malloc issue Pin
Stephen Hewitt29-Jul-06 2:39
Stephen Hewitt29-Jul-06 2:39 

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.