Click here to Skip to main content
15,915,703 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Parsing a integer value as a Parameter Pin
Phoenix10124-Oct-06 21:26
Phoenix10124-Oct-06 21:26 
AnswerRe: Parsing a integer value as a Parameter Pin
Nemanja Trifunovic24-Oct-06 9:39
Nemanja Trifunovic24-Oct-06 9:39 
QuestionA simple question about memory reallocation Pin
pani6824-Oct-06 8:25
pani6824-Oct-06 8:25 
AnswerRe: A simple question about memory reallocation Pin
David Crow24-Oct-06 8:29
David Crow24-Oct-06 8:29 
AnswerRe: A simple question about memory reallocation Pin
Mark Salsbery24-Oct-06 8:44
Mark Salsbery24-Oct-06 8:44 
AnswerRe: A simple question about memory reallocation Pin
Zac Howland24-Oct-06 10:57
Zac Howland24-Oct-06 10:57 
AnswerRe: A simple question about memory reallocation Pin
cmk24-Oct-06 11:25
cmk24-Oct-06 11:25 
GeneralRe: A simple question about memory reallocation Pin
Zac Howland24-Oct-06 11:36
Zac Howland24-Oct-06 11:36 
cmk wrote:
I'm sure he realizes that vector has to do the same thing as realloc using new/delete, but much less efficiently.


Not really. vector uses an algorithm to pre-buffer memory for you. That is, when it needs to resize, it doesn't just add 1 new element to the list, it increases the buffer by a % of what it currently is (50% if memory serves me correct). This decreases the number of allocations needed, so instead of calling realloc 49 times to allocation space for 50 integers, it might have to call new once and copy over the old data to the new buffer.

cmk wrote:
The next step up from that would be to alloc/manage your own virtual memory block.


Not when using C++ ... perhaps if you wanted to use pure C and manage your own memory ... but even then, that is a poor choice.

If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week

Zac

GeneralRe: A simple question about memory reallocation Pin
cmk25-Oct-06 6:11
cmk25-Oct-06 6:11 
GeneralRe: A simple question about memory reallocation Pin
Zac Howland25-Oct-06 6:28
Zac Howland25-Oct-06 6:28 
GeneralRe: A simple question about memory reallocation Pin
cmk25-Oct-06 8:10
cmk25-Oct-06 8:10 
GeneralRe: A simple question about memory reallocation Pin
Zac Howland25-Oct-06 8:35
Zac Howland25-Oct-06 8:35 
QuestionText does not show on toolbar Pin
peterchen24-Oct-06 7:35
peterchen24-Oct-06 7:35 
AnswerRe: Text does not show on toolbar Pin
Mark Salsbery24-Oct-06 7:59
Mark Salsbery24-Oct-06 7:59 
GeneralRe: Text does not show on toolbar Pin
peterchen24-Oct-06 13:02
peterchen24-Oct-06 13:02 
GeneralRe: Text does not show on toolbar Pin
Mark Salsbery24-Oct-06 13:14
Mark Salsbery24-Oct-06 13:14 
Questionnavigation for vectorRichEditBox Pin
prithaa24-Oct-06 7:11
prithaa24-Oct-06 7:11 
AnswerRe: navigation for vectorRichEditBox Pin
prithaa24-Oct-06 7:18
prithaa24-Oct-06 7:18 
GeneralRe: navigation for vectorRichEditBox Pin
prithaa24-Oct-06 7:25
prithaa24-Oct-06 7:25 
QuestionRe: navigation for vectorRichEditBox Pin
Maximilien24-Oct-06 7:58
Maximilien24-Oct-06 7:58 
AnswerRe: navigation for vectorRichEditBox Pin
prithaa24-Oct-06 8:11
prithaa24-Oct-06 8:11 
GeneralRe: navigation for vectorRichEditBox Pin
Mark Salsbery24-Oct-06 8:28
Mark Salsbery24-Oct-06 8:28 
AnswerRe: navigation for vectorRichEditBox Pin
David Crow24-Oct-06 8:32
David Crow24-Oct-06 8:32 
GeneralRe: navigation for vectorRichEditBox Pin
prithaa24-Oct-06 9:50
prithaa24-Oct-06 9:50 
GeneralRe: navigation for vectorRichEditBox Pin
prithaa24-Oct-06 10:07
prithaa24-Oct-06 10:07 

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.