Click here to Skip to main content
15,909,445 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: finding a string in a CString Pin
#realJSOP5-Aug-01 5:02
professional#realJSOP5-Aug-01 5:02 
GeneralRemoving Help button from Wizard Pin
4-Aug-01 20:53
suss4-Aug-01 20:53 
GeneralRe: Removing Help button from Wizard Pin
Bill Leibold4-Aug-01 21:30
Bill Leibold4-Aug-01 21:30 
GeneralRe: Removing Help button from Wizard Pin
Paolo Messina5-Aug-01 5:54
professionalPaolo Messina5-Aug-01 5:54 
GeneralMaintaining Referential Integrity Pin
Reno Tiko4-Aug-01 15:37
Reno Tiko4-Aug-01 15:37 
GeneralUsing CTabCtrl Effectivelty Pin
AJ1234-Aug-01 12:11
AJ1234-Aug-01 12:11 
QuestionWhat's the difference? Pin
4-Aug-01 10:21
suss4-Aug-01 10:21 
AnswerRe: What's the difference? Pin
Chris Losinger4-Aug-01 10:26
professionalChris Losinger4-Aug-01 10:26 
10 ints. Smile | :)

in the first sample, the 30 ints are allocated on the stack and are therefore cleaned-up automatically when the program leaves the function - so they don't live outside that function. in the second, they are allocated on the heap and you have to clean them up yourself.

one benefit of the first is automatic clean up. one benefit of the second is that the data can have a lifetime longer than that of the function that allocated it.

just a note: in general, it's not nice to allocate large amounts of memory on the stack (30 ints isn't "large").

-c

------------------------------
Smaller Animals Software, Inc.
http://www.smalleranimals.com
GeneralRe: What's the difference? Pin
4-Aug-01 10:32
suss4-Aug-01 10:32 
GeneralRe: What's the difference? Pin
Christian Graus4-Aug-01 11:39
protectorChristian Graus4-Aug-01 11:39 
GeneralRe: What's the difference? Pin
Ben Burnett4-Aug-01 11:40
Ben Burnett4-Aug-01 11:40 
GeneralRe: What's the difference? Pin
Christian Graus4-Aug-01 11:43
protectorChristian Graus4-Aug-01 11:43 
GeneralRe: What's the difference? Pin
Ben Burnett4-Aug-01 12:00
Ben Burnett4-Aug-01 12:00 
GeneralRe: Gloabl variabl, reference & pointer. Pin
Masaaki Onishi5-Aug-01 6:27
Masaaki Onishi5-Aug-01 6:27 
GeneralRe: What's the difference? Pin
Joe Woodbury5-Aug-01 9:03
professionalJoe Woodbury5-Aug-01 9:03 
Generallinked list with fast sorting Pin
4-Aug-01 4:17
suss4-Aug-01 4:17 
GeneralRe: linked list with fast sorting Pin
Christian Graus4-Aug-01 11:41
protectorChristian Graus4-Aug-01 11:41 
GeneralRe: linked list with fast sorting Pin
6-Aug-01 0:12
suss6-Aug-01 0:12 
GeneralRe: linked list with fast sorting Pin
Malcolm McMahon6-Aug-01 2:40
Malcolm McMahon6-Aug-01 2:40 
GeneralRe: linked list with fast sorting Pin
6-Aug-01 4:08
suss6-Aug-01 4:08 
GeneralRe: linked list with fast sorting Pin
Malcolm McMahon6-Aug-01 5:09
Malcolm McMahon6-Aug-01 5:09 
GeneralRe: linked list with fast sorting Pin
7-Aug-01 1:09
suss7-Aug-01 1:09 
GeneralThread Client\Serveur Pin
4-Aug-01 4:16
suss4-Aug-01 4:16 
GeneralRe: Thread Client\Serveur Pin
4-Aug-01 4:19
suss4-Aug-01 4:19 
GeneralRe: Thread Client\Serveur Pin
Baafie4-Aug-01 14:29
Baafie4-Aug-01 14: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.