Click here to Skip to main content
16,016,537 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Memory Leaks Pin
JohnnyG22-May-02 8:55
JohnnyG22-May-02 8:55 
GeneralRe: Memory Leaks Pin
Tim Smith22-May-02 8:58
Tim Smith22-May-02 8:58 
GeneralRe: Memory Leaks Pin
Alex Cramer22-May-02 20:53
Alex Cramer22-May-02 20:53 
GeneralCListBox avoid (scrollbar-)repaint while updating items Pin
22-May-02 3:47
suss22-May-02 3:47 
GeneralRe: CListBox avoid (scrollbar-)repaint while updating items Pin
Chris Losinger22-May-02 3:56
professionalChris Losinger22-May-02 3:56 
GeneralRe: CListBox avoid (scrollbar-)repaint while updating items Pin
Tim Smith22-May-02 4:56
Tim Smith22-May-02 4:56 
GeneralRe: CListBox avoid (scrollbar-)repaint while updating items Pin
22-May-02 8:25
suss22-May-02 8:25 
QuestionStructs: on heap or stack? Pin
Anton A. Loukine22-May-02 3:48
Anton A. Loukine22-May-02 3:48 
Suppose I have a struct of the following type:

struct BBG_SECURITIES {
long nRecords; // Number of Entries
CString *sName; // Security Name
CString *sTicker; // Security Ticker
CString *sMarket; // Security Market
CString *sIssuer; // Issuer
CString *sCoupon; // Coupon
CString *sFrequency; // Frequency
CString *sMaturity; // Maturity Date
CString *sCurrency; // Currency
CString *sCountry; // Country
CString *sDBRS; // DBRS Bond Rating
CString *sSP; // S&P Bond Rating
CString *sMoody; // Moody's Bond Rating
CString *sBloomberg; // Bloomberg Composite Bond Rating
};

As you can see it has a combinantion of heap and stack variables inside. Is it a good practice first of all?

I expect to have no more than 1000 records. When creating a new struct of BBG_SECURITIES type, am I better off declaring it on heap or on stack? I have read somewhere that all structs are extually declared on stack (is this true?). I expect to use the struct created quite often in the program, and I will need speed but I do not want to put a drain on memory (cause I will need a lot of it for something else as well).

Thanks.
AnswerRe: Structs: on heap or stack? Pin
Joaquín M López Muñoz22-May-02 4:23
Joaquín M López Muñoz22-May-02 4:23 
GeneralRe: Structs: on heap or stack? Pin
Anton A. Loukine22-May-02 6:31
Anton A. Loukine22-May-02 6:31 
GeneralRe: Structs: on heap or stack? Pin
Joaquín M López Muñoz22-May-02 6:44
Joaquín M López Muñoz22-May-02 6:44 
GeneralOwner draw help please. Pin
cycosi22-May-02 3:39
cycosi22-May-02 3:39 
GeneralRe: Owner draw help please. Pin
Roger Allen22-May-02 6:26
Roger Allen22-May-02 6:26 
GeneralRe: Owner draw help please. Pin
cycosi22-May-02 20:48
cycosi22-May-02 20:48 
GeneralRe: Owner draw help please. Pin
cycosi22-May-02 23:08
cycosi22-May-02 23:08 
GeneralMemory: debug vs. real world (3) Pin
Mike Osbahr22-May-02 3:24
Mike Osbahr22-May-02 3:24 
GeneralRe: Memory: debug vs. real world (3) Pin
Tim Smith22-May-02 5:00
Tim Smith22-May-02 5:00 
GeneralRe: Memory: debug vs. real world (3) Pin
Mike Osbahr22-May-02 5:54
Mike Osbahr22-May-02 5:54 
GeneralRe: Memory: debug vs. real world (3) Pin
Tim Smith22-May-02 7:39
Tim Smith22-May-02 7:39 
GeneralRe: Memory: debug vs. real world (3) Pin
Mike Osbahr22-May-02 9:39
Mike Osbahr22-May-02 9:39 
GeneralRe: Memory: debug vs. real world (3) Pin
Mike Nordell23-May-02 3:48
Mike Nordell23-May-02 3:48 
GeneralCDialog Pin
Zizilamoroso22-May-02 3:06
Zizilamoroso22-May-02 3:06 
GeneralRe: CDialog Pin
Martin Ziacek22-May-02 3:29
Martin Ziacek22-May-02 3:29 
GeneralRe: CDialog Pin
Zizilamoroso22-May-02 3:28
Zizilamoroso22-May-02 3:28 
GeneralRe: CDialog Pin
Zizilamoroso22-May-02 3:29
Zizilamoroso22-May-02 3:29 

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.