Click here to Skip to main content
15,914,447 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: StayOnTop for window. Pin
int01h22-Oct-02 13:39
int01h22-Oct-02 13:39 
GeneralRe: StayOnTop for window. Pin
Christian Graus22-Oct-02 13:44
protectorChristian Graus22-Oct-02 13:44 
GeneralRe: StayOnTop for window. Pin
Anonymous23-Oct-02 4:31
Anonymous23-Oct-02 4:31 
GeneralRe: StayOnTop for window. Pin
Paul M Watt22-Oct-02 14:13
mentorPaul M Watt22-Oct-02 14:13 
GeneralRe: StayOnTop for window. Pin
Christian Graus22-Oct-02 15:34
protectorChristian Graus22-Oct-02 15:34 
GeneralC++ Memory Allocation and Memory Leakage Pin
Anonymous22-Oct-02 13:15
Anonymous22-Oct-02 13:15 
GeneralRe: C++ Memory Allocation and Memory Leakage Pin
Christian Graus22-Oct-02 13:30
protectorChristian Graus22-Oct-02 13:30 
GeneralRe: C++ Memory Allocation and Memory Leakage Pin
Paul Oss22-Oct-02 13:38
Paul Oss22-Oct-02 13:38 
I'm not quite sure exactly what you're asking, but I'll address the particular question you asked earlier in the post:

Anonymous wrote:
In allocating memory dynamically in an application either globally or in a class-specific scope, how does a person know what is actually happening in the "pool called the free store"?

Basically, at that point the operating system is giving you memory from the available ram on the system (called somewhat generically 'free-store') and returning an address to that ram (that address being a relative address, not an absolute). You as the programmer shouldn't have to worry about 'what happens' in the pool. Theoretically, nothing should 'happen' to that memory at all, except that it's now allocated to your particular process, and the operating system more than likely marks it as such so other processes (naturally) don't get ahold of it.

Now, to address some other stuff you loosely talked about, such as allocating a c++ class and automatic calling of a constructor-- those things have little to do with the 'free-store' but have a lot to do with the methodology of a c++ program. Don't allow the text: "when new is used to allocate memory for a C++ class object, the object's constructor is called after the memory is allocated" confuse you. The two things happening in the description have nothing to do with eachother (technically). If I instantiate a c++ object (class) its constructor is automatically called. If I do the same thing using the NEW operator, then its constructor is automatically called. The only difference is that the 'new' operator dynamically allocates the memory space for the new class on the heap, and then calls a constructor. If I allocate 'int' or 'char' or 'float' with the 'new' operator, the same thing occurs on the free-store (as it's called), but no constructors are called because they're not c++ classes but base data types.

Does this help at all?

Paul Oss
GeneralRe: C++ Memory Allocation and Memory Leakage Pin
Paul M Watt22-Oct-02 13:45
mentorPaul M Watt22-Oct-02 13:45 
GeneralRe: C++ Memory Allocation and Memory Leakage Pin
Christian Graus22-Oct-02 15:35
protectorChristian Graus22-Oct-02 15:35 
GeneralRe: C++ Memory Allocation and Memory Leakage Pin
ursus zeta23-Oct-02 9:47
ursus zeta23-Oct-02 9:47 
QuestionTracking ToolTips in a CControlBar? Pin
Jim A. Johnson22-Oct-02 12:58
Jim A. Johnson22-Oct-02 12:58 
AnswerRe: Tracking ToolTips in a CControlBar? Pin
Maximilien22-Oct-02 15:13
Maximilien22-Oct-02 15:13 
GeneralViews Pin
Anonymous22-Oct-02 12:56
Anonymous22-Oct-02 12:56 
GeneralRe: Views Pin
Ben Burnett22-Oct-02 14:13
Ben Burnett22-Oct-02 14:13 
GeneralHide the Windows Clock Pin
alpha+22-Oct-02 12:52
alpha+22-Oct-02 12:52 
GeneralDialogBox Pin
G. White22-Oct-02 12:37
G. White22-Oct-02 12:37 
GeneralRe: DialogBox Pin
Paul M Watt22-Oct-02 12:46
mentorPaul M Watt22-Oct-02 12:46 
GeneralRe: DialogBox Pin
Christian Graus22-Oct-02 13:19
protectorChristian Graus22-Oct-02 13:19 
QuestionTerminating window-less process? Pin
Abin22-Oct-02 12:29
Abin22-Oct-02 12:29 
AnswerRe: Terminating window-less process? Pin
Hans Ruck22-Oct-02 23:41
Hans Ruck22-Oct-02 23:41 
Generaloverloaded operator new and STL vector Pin
Nemanja Trifunovic22-Oct-02 12:30
Nemanja Trifunovic22-Oct-02 12:30 
GeneralRe: overloaded operator new and STL vector Pin
Christian Graus22-Oct-02 13:34
protectorChristian Graus22-Oct-02 13:34 
GeneralRe: overloaded operator new and STL vector Pin
Nemanja Trifunovic22-Oct-02 15:58
Nemanja Trifunovic22-Oct-02 15:58 
GeneralRe: overloaded operator new and STL vector Pin
Christian Graus22-Oct-02 16:01
protectorChristian Graus22-Oct-02 16:01 

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.