Click here to Skip to main content
15,912,329 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: How to convert CString to char[] in MFC?(Very Urgent............) Pin
David Crow3-Mar-09 3:11
David Crow3-Mar-09 3:11 
AnswerRe: How to convert CString to char[] in MFC?(Very Urgent............) Pin
Eytukan3-Mar-09 4:38
Eytukan3-Mar-09 4:38 
GeneralRe: How to convert CString to char[] in MFC?(Very Urgent............) Pin
David Crow3-Mar-09 4:42
David Crow3-Mar-09 4:42 
GeneralRe: How to convert CString to char[] in MFC?(Very Urgent............) Pin
Eytukan3-Mar-09 4:47
Eytukan3-Mar-09 4:47 
QuestionEfficiency question Pin
yellowine2-Mar-09 10:39
yellowine2-Mar-09 10:39 
AnswerRe: Efficiency question Pin
Stuart Dootson2-Mar-09 10:46
professionalStuart Dootson2-Mar-09 10:46 
AnswerRe: Efficiency question Pin
Maximilien2-Mar-09 13:31
Maximilien2-Mar-09 13:31 
AnswerRe: Efficiency question Pin
«_Superman_»2-Mar-09 17:15
professional«_Superman_»2-Mar-09 17:15 
Below is the assembly code generated by Visual Studio 2008 for both the functions.
The code was generated with full optimization.

?Length0@@YANNNNNNN@Z PROC

	fld	QWORD PTR _x2$[esp-4]
	fsub	QWORD PTR _x1$[esp-4]
	fld	QWORD PTR _y2$[esp-4]
	fsub	QWORD PTR _y1$[esp-4]
	fld	QWORD PTR _z2$[esp-4]
	fsub	QWORD PTR _z1$[esp-4]
	fld	ST(1)
	fmulp	ST(2), ST(0)
	fld	ST(2)
	fmulp	ST(3), ST(0)
	fxch	ST(1)
	faddp	ST(2), ST(0)
	fmul	ST(0), ST(0)
	faddp	ST(1), ST(0)

	ret	0
	
?Length0@@YANNNNNNN@Z ENDP

?Length1@@YANNNNNNN@Z PROC

	fld	QWORD PTR _x2$[esp-4]
	fsub	QWORD PTR _x1$[esp-4]
	fld	QWORD PTR _y2$[esp-4]
	fsub	QWORD PTR _y1$[esp-4]
	fld	QWORD PTR _z2$[esp-4]
	fsub	QWORD PTR _z1$[esp-4]
	fld	ST(1)
	fmulp	ST(2), ST(0)
	fld	ST(2)
	fmulp	ST(3), ST(0)
	fxch	ST(1)
	faddp	ST(2), ST(0)
	fmul	ST(0), ST(0)
	faddp	ST(1), ST(0)

	ret	0
	
?Length1@@YANNNNNNN@Z ENDP


Here you will notice that both are exactly the same.
The compiler has taken away the responsibility from the programmer about optimizing code. At least a lot of it. Smile | :)

«_Superman
I love work. It gives me something to do between weekends.

AnswerRe: Efficiency question Pin
Eytukan2-Mar-09 20:17
Eytukan2-Mar-09 20:17 
QuestionReplacing contents of a file Pin
Neelesh K J Jain2-Mar-09 9:58
Neelesh K J Jain2-Mar-09 9:58 
AnswerRe: Replacing contents of a file Pin
CPallini2-Mar-09 10:09
mveCPallini2-Mar-09 10:09 
GeneralRe: Replacing contents of a file Pin
Rajesh R Subramanian2-Mar-09 19:53
professionalRajesh R Subramanian2-Mar-09 19:53 
JokeRe: Replacing contents of a file Pin
CPallini2-Mar-09 21:18
mveCPallini2-Mar-09 21:18 
QuestionOnAppExit not called when X button clicked Pin
TimmySRX2-Mar-09 9:49
TimmySRX2-Mar-09 9:49 
AnswerRe: OnAppExit not called when X button clicked Pin
Stuart Dootson2-Mar-09 10:15
professionalStuart Dootson2-Mar-09 10:15 
GeneralRe: OnAppExit not called when X button clicked Pin
TimmySRX2-Mar-09 11:05
TimmySRX2-Mar-09 11:05 
GeneralRe: OnAppExit not called when X button clicked Pin
Iain Clarke, Warrior Programmer2-Mar-09 23:04
Iain Clarke, Warrior Programmer2-Mar-09 23:04 
QuestionSendKeys won't work Pin
Ran42-Mar-09 8:49
Ran42-Mar-09 8:49 
AnswerRe: SendKeys won't work Pin
led mike2-Mar-09 9:49
led mike2-Mar-09 9:49 
GeneralRe: SendKeys won't work Pin
Ran42-Mar-09 10:14
Ran42-Mar-09 10:14 
GeneralRe: SendKeys won't work Pin
CPallini2-Mar-09 10:19
mveCPallini2-Mar-09 10:19 
AnswerRe: SendKeys won't work Pin
«_Superman_»2-Mar-09 17:33
professional«_Superman_»2-Mar-09 17:33 
GeneralRe: SendKeys won't work Pin
davidjaybrown3-Mar-09 8:49
davidjaybrown3-Mar-09 8:49 
GeneralRe: SendKeys won't work Pin
«_Superman_»3-Mar-09 15:59
professional«_Superman_»3-Mar-09 15:59 
QuestionCompile Error Actual linking error ....Can someone help. Pin
FISH7862-Mar-09 8:01
FISH7862-Mar-09 8: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.