Click here to Skip to main content
15,888,579 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionSingleThread dialog application which can change main dialog [modified] Pin
rudo3214-Oct-06 23:11
rudo3214-Oct-06 23:11 
AnswerRe: SingleThread dialog application which can change main dialog Pin
Joan M16-Oct-06 20:52
professionalJoan M16-Oct-06 20:52 
Questionlisbox sorting Pin
Tara1414-Oct-06 19:15
Tara1414-Oct-06 19:15 
AnswerRe: lisbox sorting Pin
Joan M16-Oct-06 20:49
professionalJoan M16-Oct-06 20:49 
QuestionPrinting Bitmaps from a Frame Grabber (Re-post of earlier question) Pin
Bob Hickey14-Oct-06 16:56
Bob Hickey14-Oct-06 16:56 
AnswerRe: Printing Bitmaps from a Frame Grabber (Re-post of earlier question) Pin
Justin Tay14-Oct-06 18:45
Justin Tay14-Oct-06 18:45 
AnswerRe: Printing Bitmaps from a Frame Grabber (Re-post of earlier question) Pin
Hamid_RT14-Oct-06 19:32
Hamid_RT14-Oct-06 19:32 
Questionsort of dumb question about memory allocation Pin
KellyR14-Oct-06 14:45
KellyR14-Oct-06 14:45 
Hi, I've been programming for years but I learned by doing rather than by anyone teaching me, and as such I have a few gaps in my knowledge.

One is memory allocation: My question is this, if I use a locally defined buffer rather than a global buffer, does it take more overhead in terms of processor power? Also, how exactly is the memory allocated (of course the global variable is allocated when the program initiates, but what about the locally defined one? Is a new instance re-allocated each time the function is called, which would certainly cost more crunch time..?). What I'm mostly interested in is: which one is more efficient, and by how much/why?

So here's an example of what I mean.

Globally defined:

char buf[128];

void do_something()
{
buf[0] = 0;
}

As opposed to locally defined:

void do_something()
{
char buf[128];
buf[0] = 0;
}

Thanks so much!



KR

AnswerRe: sort of dumb question about memory allocation Pin
Mark Salsbery14-Oct-06 15:18
Mark Salsbery14-Oct-06 15:18 
AnswerRe: sort of dumb question about memory allocation Pin
Michael Dunn14-Oct-06 21:20
sitebuilderMichael Dunn14-Oct-06 21:20 
GeneralRe: sort of dumb question about memory allocation Pin
Mark Salsbery15-Oct-06 8:14
Mark Salsbery15-Oct-06 8:14 
QuestionVC6: How do I execute an exe contained in my resources? Pin
tssyf14-Oct-06 14:17
tssyf14-Oct-06 14:17 
AnswerRe: VC6: How do I execute an exe contained in my resources? Pin
Gerald Schwab14-Oct-06 15:07
Gerald Schwab14-Oct-06 15:07 
GeneralRe: VC6: How do I execute an exe contained in my resources? Pin
tssyf14-Oct-06 15:14
tssyf14-Oct-06 15:14 
GeneralRe: VC6: How do I execute an exe contained in my resources? Pin
Gerald Schwab14-Oct-06 16:14
Gerald Schwab14-Oct-06 16:14 
AnswerRe: VC6: How do I execute an exe contained in my resources? Pin
Hamid_RT16-Oct-06 9:03
Hamid_RT16-Oct-06 9:03 
QuestionTale of two pointers [modified] Pin
Oliver12314-Oct-06 11:50
Oliver12314-Oct-06 11:50 
AnswerRe: Tale of two pointers [modified] Pin
Mark Salsbery14-Oct-06 12:03
Mark Salsbery14-Oct-06 12:03 
AnswerRe: Tale of two pointers Pin
10011000100101101000014-Oct-06 12:18
10011000100101101000014-Oct-06 12:18 
AnswerRe: Tale of two pointers Pin
Hamid_RT14-Oct-06 19:13
Hamid_RT14-Oct-06 19:13 
QuestionCompatibility between Java and VC++ in socket programming Pin
lchild38514-Oct-06 9:52
lchild38514-Oct-06 9:52 
AnswerRe: Compatibility between Java and VC++ in socket programming Pin
Mark Salsbery14-Oct-06 10:03
Mark Salsbery14-Oct-06 10:03 
GeneralRe: Compatibility between Java and VC++ in socket programming Pin
lchild38516-Oct-06 7:58
lchild38516-Oct-06 7:58 
GeneralRe: Compatibility between Java and VC++ in socket programming Pin
Mark Salsbery16-Oct-06 8:02
Mark Salsbery16-Oct-06 8:02 
GeneralRe: Compatibility between Java and VC++ in socket programming Pin
lchild38519-Oct-06 8:57
lchild38519-Oct-06 8:57 

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.