Click here to Skip to main content
15,887,267 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: else does nto return expected value Pin
jharn26-Jan-11 10:08
jharn26-Jan-11 10:08 
GeneralRe: else does nto return expected value Pin
TheGreatAndPowerfulOz26-Jan-11 10:14
TheGreatAndPowerfulOz26-Jan-11 10:14 
GeneralRe: else does nto return expected value Pin
Cedric Moonen26-Jan-11 20:35
Cedric Moonen26-Jan-11 20:35 
GeneralRe: else does nto return expected value Pin
Stefan_Lang27-Jan-11 2:20
Stefan_Lang27-Jan-11 2:20 
AnswerRe: else does nto return expected value Pin
Richard MacCutchan26-Jan-11 22:41
mveRichard MacCutchan26-Jan-11 22:41 
QuestionReturning a Reference Pin
Anthony Mushrow26-Jan-11 7:59
professionalAnthony Mushrow26-Jan-11 7:59 
AnswerRe: Returning a Reference Pin
dasblinkenlight26-Jan-11 8:26
dasblinkenlight26-Jan-11 8:26 
AnswerRe: Returning a Reference [modified] Pin
TheGreatAndPowerfulOz26-Jan-11 9:39
TheGreatAndPowerfulOz26-Jan-11 9:39 
What you're trying to do is reassign the reference, which you can't do. It's a common mistake to make. What is actually occurring is the operator= is being called, but since you don't supply an implementation, it calls the compiler generated one. The compiler generated one essentially does nothing (EDIT: in this case).

For primitive values, like in your first example, works like you would think because it's just transferring values.

You can "reassign" the reference like this:
&get() = &argh;

"If your actions inspire others to dream more, learn more, do more and become more, you are a leader." - John Quincy Adams
modified on Thursday, January 27, 2011 1:59 PM

GeneralRe: Returning a Reference Pin
Emilio Garavaglia26-Jan-11 22:58
Emilio Garavaglia26-Jan-11 22:58 
GeneralRe: Returning a Reference Pin
Stefan_Lang27-Jan-11 1:57
Stefan_Lang27-Jan-11 1:57 
GeneralRe: Returning a Reference Pin
TheGreatAndPowerfulOz27-Jan-11 8:23
TheGreatAndPowerfulOz27-Jan-11 8:23 
GeneralRe: Returning a Reference Pin
Niklas L26-Jan-11 23:20
Niklas L26-Jan-11 23:20 
GeneralRe: Returning a Reference Pin
Stefan_Lang26-Jan-11 23:57
Stefan_Lang26-Jan-11 23:57 
GeneralRe: Returning a Reference Pin
Niklas L27-Jan-11 1:07
Niklas L27-Jan-11 1:07 
GeneralRe: Returning a Reference Pin
Stefan_Lang27-Jan-11 1:20
Stefan_Lang27-Jan-11 1:20 
GeneralRe: Returning a Reference Pin
TheGreatAndPowerfulOz27-Jan-11 8:02
TheGreatAndPowerfulOz27-Jan-11 8:02 
AnswerRe: Returning a Reference [modified] Pin
Stefan_Lang26-Jan-11 23:12
Stefan_Lang26-Jan-11 23:12 
QuestionAny fast and efficient compress/decompress code? Pin
includeh1026-Jan-11 6:53
includeh1026-Jan-11 6:53 
AnswerRe: Any fast and efficient compress/decompress code? Pin
Anthony Mushrow26-Jan-11 7:41
professionalAnthony Mushrow26-Jan-11 7:41 
AnswerRe: Any fast and efficient compress/decompress code? Pin
Rolf Kristensen26-Jan-11 8:45
Rolf Kristensen26-Jan-11 8:45 
QuestionCapturing stdout from an external program Pin
piul26-Jan-11 3:50
piul26-Jan-11 3:50 
AnswerRe: Capturing stdout from an external program Pin
David Crow26-Jan-11 3:55
David Crow26-Jan-11 3:55 
GeneralRe: Capturing stdout from an external program Pin
piul26-Jan-11 4:43
piul26-Jan-11 4:43 
GeneralRe: Capturing stdout from an external program Pin
David Crow26-Jan-11 5:40
David Crow26-Jan-11 5:40 
QuestionHow to get a CBitmap from a LPDIRECTDRAWSURFACE7 [Solved] Pin
kagelind26-Jan-11 3:01
kagelind26-Jan-11 3: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.