Click here to Skip to main content
15,394,715 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Is it ok to use uninitialized pointer? [modified] Pin
Cedric Moonen4-Aug-10 20:48
MemberCedric Moonen4-Aug-10 20:48 
GeneralRe: Is it ok to use uninitialized pointer? Pin
CPallini4-Aug-10 20:57
mveCPallini4-Aug-10 20:57 
GeneralRe: Is it ok to use uninitialized pointer? Pin
Cedric Moonen4-Aug-10 21:07
MemberCedric Moonen4-Aug-10 21:07 
GeneralRe: Is it ok to use uninitialized pointer? Pin
CPallini4-Aug-10 21:15
mveCPallini4-Aug-10 21:15 
AnswerRe: Is it ok to use uninitialized pointer? [modified] Pin
bleedingfingers4-Aug-10 21:19
Memberbleedingfingers4-Aug-10 21:19 
AnswerRe: Is it ok to use uninitialized pointer? Pin
Sameerkumar Namdeo4-Aug-10 23:17
MemberSameerkumar Namdeo4-Aug-10 23:17 
AnswerRe: Is it ok to use uninitialized pointer? Pin
MuraliKrishnaP5-Aug-10 9:44
MemberMuraliKrishnaP5-Aug-10 9:44 
Questionwhy const pointer is NOT const? how to solve the problem? Pin
includeh104-Aug-10 13:12
Memberincludeh104-Aug-10 13:12 
my app crashed, i suspect some of const class members are not initialized.

actually, compiler can not detect uninitialized const pointers, i.e.
const CWnd*pc;

as class member, but there is no error if forgot to initialize it.

why? - I don't think that default value of NULL is good reason to allow code above be compiled.

so I did a test inside a function, which shows no error:
const CWnd*pc0=0;
CWnd*pc1=(CWnd*)100;
pc0=pc1;


for other types of data, such as int, above code can not be compiled.

Any idea to solve the problem to make sure const pointer must be inilialized?
AnswerRe: why const pointer is NOT const? how to solve the problem? PinPopular
KingsGambit4-Aug-10 17:02
MemberKingsGambit4-Aug-10 17:02 
AnswerRe: why const pointer is NOT const? how to solve the problem? Pin
Aescleal5-Aug-10 0:02
MemberAescleal5-Aug-10 0:02 
QuestionHow to get physical memory size available to a process? Pin
Code-o-mat4-Aug-10 11:25
MemberCode-o-mat4-Aug-10 11:25 
QuestionRe: How to get physical memory size available to a process? Pin
norish5-Aug-10 4:38
Membernorish5-Aug-10 4:38 
AnswerRe: How to get physical memory size available to a process? Pin
Code-o-mat5-Aug-10 4:54
MemberCode-o-mat5-Aug-10 4:54 
GeneralRe: How to get physical memory size available to a process? Pin
norish5-Aug-10 19:48
Membernorish5-Aug-10 19:48 
GeneralRe: How to get physical memory size available to a process? Pin
Code-o-mat5-Aug-10 21:55
MemberCode-o-mat5-Aug-10 21:55 
QuestionGet/Kill focus in MFC Pin
geoyar4-Aug-10 9:23
professionalgeoyar4-Aug-10 9:23 
AnswerRe: Get/Kill focus in MFC Pin
Code-o-mat4-Aug-10 11:15
MemberCode-o-mat4-Aug-10 11:15 
GeneralRe: Get/Kill focus in MFC Pin
geoyar5-Aug-10 12:19
professionalgeoyar5-Aug-10 12:19 
GeneralRe: Get/Kill focus in MFC Pin
Code-o-mat5-Aug-10 21:52
MemberCode-o-mat5-Aug-10 21:52 
GeneralRe: Get/Kill focus in MFC Pin
geoyar6-Aug-10 7:29
professionalgeoyar6-Aug-10 7:29 
GeneralRe: Get/Kill focus in MFC Pin
Code-o-mat6-Aug-10 8:35
MemberCode-o-mat6-Aug-10 8:35 
GeneralRe: Get/Kill focus in MFC Pin
geoyar6-Aug-10 10:01
professionalgeoyar6-Aug-10 10:01 
GeneralRe: Get/Kill focus in MFC Pin
Code-o-mat6-Aug-10 10:06
MemberCode-o-mat6-Aug-10 10:06 
GeneralRe: Get/Kill focus in MFC Pin
geoyar6-Aug-10 11:31
professionalgeoyar6-Aug-10 11:31 
GeneralRe: Get/Kill focus in MFC Pin
Code-o-mat6-Aug-10 11:36
MemberCode-o-mat6-Aug-10 11:36 

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.