Click here to Skip to main content
16,004,778 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionemail page creation Pin
santhi_malli10-May-07 19:42
santhi_malli10-May-07 19:42 
QuestionClass and pointer Pin
C_Zealot10-May-07 18:43
C_Zealot10-May-07 18:43 
AnswerRe: Class and pointer Pin
bob1697210-May-07 19:18
bob1697210-May-07 19:18 
GeneralRe: Class and pointer Pin
C_Zealot10-May-07 19:35
C_Zealot10-May-07 19:35 
GeneralRe: Class and pointer Pin
bob1697210-May-07 19:53
bob1697210-May-07 19:53 
AnswerRe: Class and pointer Pin
vibindia10-May-07 19:27
vibindia10-May-07 19:27 
GeneralRe: Class and pointer Pin
C_Zealot10-May-07 19:36
C_Zealot10-May-07 19:36 
AnswerRe: Class and pointer Pin
Stephen Hewitt10-May-07 19:36
Stephen Hewitt10-May-07 19:36 
You have an array of pointers to chars called ‘stk’. As far as I can see these pointers are not initialized, so they point at some random location. You push values on the stack like this:
*stk[stkIndex++] = i;

Let’s break this up (underlined part being considered):
*stk[stkIndex++] = i

This statement evaluates to a reference to one of the elements of the ‘stk’ array. Remember these elements are uninitialized pointers.
*stk[stkIndex++] = i

This dereferences the pointer which result in a reference to some RANDOM area of memory which we interpret as a char.
*stk[stkIndex++] = i

This writes the integer truncated to a char (which is another issue with your code) to the some RANDOM area of memory. Crash!


Steve

GeneralRe: Class and pointer Pin
C_Zealot10-May-07 19:39
C_Zealot10-May-07 19:39 
GeneralRe: Class and pointer Pin
Stephen Hewitt10-May-07 19:44
Stephen Hewitt10-May-07 19:44 
QuestionHow to get the width & height of MPEG files with DirectX SDK? Pin
raytracingx10-May-07 18:05
raytracingx10-May-07 18:05 
AnswerRe: How to get the width & height of MPEG files with DirectX SDK? Pin
Hamid_RT11-May-07 0:42
Hamid_RT11-May-07 0:42 
GeneralRe: How to get the width & height of MPEG files with DirectX SDK? Pin
raytracingx13-May-07 16:08
raytracingx13-May-07 16:08 
QuestionApplication Data Directories Pin
Richard Andrew x6410-May-07 18:02
professionalRichard Andrew x6410-May-07 18:02 
QuestionThread parameter use same value for all thread ????? Pin
amitmistry_petlad 10-May-07 17:55
amitmistry_petlad 10-May-07 17:55 
AnswerRe: Thread parameter use same value for all thread ????? Pin
Arman S.10-May-07 20:40
Arman S.10-May-07 20:40 
GeneralRe: Thread parameter use same value for all thread ????? Pin
amitmistry_petlad 10-May-07 21:10
amitmistry_petlad 10-May-07 21:10 
GeneralRe: Thread parameter use same value for all thread ????? Pin
Arman S.11-May-07 0:13
Arman S.11-May-07 0:13 
GeneralRe: Thread parameter use same value for all thread ????? Pin
Arman S.11-May-07 1:01
Arman S.11-May-07 1:01 
GeneralRe: Thread parameter use same value for all thread ????? Pin
amitmistry_petlad 11-May-07 1:15
amitmistry_petlad 11-May-07 1:15 
GeneralRe: Thread parameter use same value for all thread ????? Pin
Arman S.11-May-07 1:44
Arman S.11-May-07 1:44 
GeneralRe: Thread parameter use same value for all thread ????? Pin
Arman S.11-May-07 2:52
Arman S.11-May-07 2:52 
GeneralRe: Thread parameter use same value for all thread ????? Pin
amitmistry_petlad 13-May-07 19:24
amitmistry_petlad 13-May-07 19:24 
GeneralRe: Thread parameter use same value for all thread ????? Pin
amitmistry_petlad 16-May-07 22:55
amitmistry_petlad 16-May-07 22:55 
AnswerRe: Thread parameter use same value for all thread ????? Pin
ThatsAlok17-May-07 1:54
ThatsAlok17-May-07 1:54 

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.