Click here to Skip to main content
15,911,315 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Set Text bold in edit control Pin
Rajesh R Subramanian23-Apr-07 23:31
professionalRajesh R Subramanian23-Apr-07 23:31 
GeneralRe: Set Text bold in edit control Pin
David Crow24-Apr-07 3:08
David Crow24-Apr-07 3:08 
GeneralRe: Set Text bold in edit control Pin
sireesha_sree23-Apr-07 23:26
sireesha_sree23-Apr-07 23:26 
AnswerRe: Set Text bold in edit control Pin
prasad_som23-Apr-07 23:52
prasad_som23-Apr-07 23:52 
QuestionCustom Menu Keyboard Handling Pin
Nishad S23-Apr-07 22:38
Nishad S23-Apr-07 22:38 
AnswerRe: Custom Menu Keyboard Handling Pin
Ranjoy Guha24-Apr-07 2:08
Ranjoy Guha24-Apr-07 2:08 
QuestionWhere is stack frame Pin
sawerr23-Apr-07 22:07
sawerr23-Apr-07 22:07 
AnswerRe: Where is stack frame Pin
Mark Salsbery24-Apr-07 8:33
Mark Salsbery24-Apr-07 8:33 
sawerr wrote:
i really confused about where the stack frame of func. is


What do you mean by where it is?

The stack is a reserved area of memory pointed to by a CPU stack pointer register.
Each thread has its own stack.
For compilers that put local variables on the stack, the stack frame is the block of stack area
memory big enough to hold the local variables.

I don't know if a stack is required by the C/C++ language. Every CPU I've used had a stack and
that stack is used for local variables, but I suppose local variables could be stored anywhere a
compiler chooses to.

A typical stack pointer points to the next available byte in the stack, working downword in
memory. A typical C function call will first "push" the return address onto the stack,
decrement the stack pointer by the size of the return address, and call the function.
On entry to the function, if local variable storage is needed, the compiler will make a stack
frame by subtracting the number of bytes needed from the stack pointer. At the end of the
function, the stack frame is removed by adding the same number to the stack pointer. The
return address is then "popped" from the stack and used to resume processing at that address.

This is Computers 101 stuff - maybe reading some articles on how CPUs work will help Smile | :)

Mark



"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder

Questiondatabase connection problem. Pin
david bagaturia23-Apr-07 21:26
david bagaturia23-Apr-07 21:26 
AnswerRe: database connection problem. Pin
Cedric Moonen23-Apr-07 21:43
Cedric Moonen23-Apr-07 21:43 
QuestionRe: database connection problem. Pin
David Crow24-Apr-07 3:09
David Crow24-Apr-07 3:09 
AnswerRe: database connection problem. Pin
Mark Salsbery24-Apr-07 8:34
Mark Salsbery24-Apr-07 8:34 
AnswerRe: database connection problem. Pin
Hamid_RT24-Apr-07 3:12
Hamid_RT24-Apr-07 3:12 
GeneralRe: database connection problem. Pin
david bagaturia24-Apr-07 19:29
david bagaturia24-Apr-07 19:29 
QuestionRe: database connection problem. Pin
David Crow25-Apr-07 2:51
David Crow25-Apr-07 2:51 
GeneralRe: database connection problem. Pin
Hamid_RT25-Apr-07 6:47
Hamid_RT25-Apr-07 6:47 
QuestionCFileDialog Pin
Try23-Apr-07 20:24
Try23-Apr-07 20:24 
QuestionRe: CFileDialog Pin
David Crow24-Apr-07 3:10
David Crow24-Apr-07 3:10 
AnswerRe: CFileDialog Pin
Try24-Apr-07 3:20
Try24-Apr-07 3:20 
QuestionRe: CFileDialog Pin
David Crow24-Apr-07 3:29
David Crow24-Apr-07 3:29 
AnswerRe: CFileDialog Pin
Try24-Apr-07 3:52
Try24-Apr-07 3:52 
GeneralRe: CFileDialog Pin
David Crow24-Apr-07 4:11
David Crow24-Apr-07 4:11 
GeneralRe: CFileDialog Pin
Try24-Apr-07 5:04
Try24-Apr-07 5:04 
QuestionRe: CFileDialog Pin
David Crow24-Apr-07 5:25
David Crow24-Apr-07 5:25 
AnswerRe: CFileDialog Pin
Try24-Apr-07 18:31
Try24-Apr-07 18:31 

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.