Click here to Skip to main content
15,886,919 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionconfused about system stack Pin
George_George4-Jun-06 22:54
George_George4-Jun-06 22:54 
AnswerRe: confused about system stack Pin
Viorel.5-Jun-06 0:19
Viorel.5-Jun-06 0:19 
GeneralRe: confused about system stack [modified] Pin
George_George5-Jun-06 1:38
George_George5-Jun-06 1:38 
GeneralRe: confused about system stack [modified] Pin
Viorel.5-Jun-06 2:05
Viorel.5-Jun-06 2:05 
GeneralRe: confused about system stack [modified] Pin
George_George5-Jun-06 2:24
George_George5-Jun-06 2:24 
GeneralRe: confused about system stack [modified] Pin
Viorel.5-Jun-06 3:18
Viorel.5-Jun-06 3:18 
GeneralRe: confused about system stack [modified] Pin
George_George5-Jun-06 3:38
George_George5-Jun-06 3:38 
GeneralRe: confused about system stack [modified] Pin
Viorel.5-Jun-06 3:58
Viorel.5-Jun-06 3:58 
Data segment is a storage for named variables, declared like "int x = 0;" or "static int x = 0;" outside functions, or as "static int x = 0;" inside functions. Data segment also stores initial value of arrays, like "Hello, World!" for strings, or {1, 2, 3} for integer arrays. This data segment is allocated once, when process starts, and the number of variables here cannot grow.

(One more thing which is stored in data segment is "virtual tables" of classes having virtual functions).

Heap area is for unnamed variables, allocated only when you explicitly call new or related. So the number of variables varies here during program execution.

While variables declared in global data segment can be accessed by name, the variables allocated in heap have to be accessed by pointers or references.

So the main difference between global data segment and heap is that the size of data segment is fixed, while the data allocated in the heap can vary.

That is my understanding.
GeneralRe: confused about system stack [modified] Pin
George_George6-Jun-06 19:07
George_George6-Jun-06 19:07 
GeneralRe: confused about system stack [modified] Pin
Viorel.6-Jun-06 20:58
Viorel.6-Jun-06 20:58 
GeneralRe: confused about system stack [modified] Pin
George_George6-Jun-06 21:21
George_George6-Jun-06 21:21 
QuestionQuaternion rotation Pin
lastgen4-Jun-06 22:43
lastgen4-Jun-06 22:43 
Questionhow to structure my program?? Pin
Nawar_nrr4-Jun-06 22:41
Nawar_nrr4-Jun-06 22:41 
AnswerRe: how to structure my program?? Pin
Blake Miller6-Jun-06 5:07
Blake Miller6-Jun-06 5:07 
Questionevent socket model question Pin
followait4-Jun-06 22:14
followait4-Jun-06 22:14 
GeneralRe: Does event socket model have to wait for events in another thread in an interactive app? [modified] Pin
Sarath C4-Jun-06 22:25
Sarath C4-Jun-06 22:25 
GeneralRe: Does event socket model have to wait for events in another thread in an interactive app? [modified] Pin
followait4-Jun-06 22:50
followait4-Jun-06 22:50 
QuestionStrange spin button control problem Pin
David L.S.4-Jun-06 21:33
David L.S.4-Jun-06 21:33 
AnswerRe: Strange spin button control problem Pin
PJ Arends4-Jun-06 21:54
professionalPJ Arends4-Jun-06 21:54 
GeneralRe: Strange spin button control problem Pin
David L.S.4-Jun-06 22:55
David L.S.4-Jun-06 22:55 
QuestionPlease help with recordset Pin
SWDevil4-Jun-06 21:09
SWDevil4-Jun-06 21:09 
QuestionDirectX functions - Graphics card Pin
velayudhan_raj4-Jun-06 21:01
velayudhan_raj4-Jun-06 21:01 
AnswerRe: DirectX functions - Graphics card Please help me, Its URGENT Pin
velayudhan_raj4-Jun-06 22:20
velayudhan_raj4-Jun-06 22:20 
QuestionLooking for data structures for long integer Pin
George_George4-Jun-06 20:33
George_George4-Jun-06 20:33 
AnswerRe: Looking for data structures for long integer Pin
Maxwell Chen4-Jun-06 21:03
Maxwell Chen4-Jun-06 21:03 

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.