Click here to Skip to main content
15,893,814 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
JokeRe: SOCKET : How to gracfully stop application when recv() function is blocking Pin
Code-o-mat1-Aug-11 5:57
Code-o-mat1-Aug-11 5:57 
AnswerRe: SOCKET : How to gracfully stop application when recv() function is blocking Pin
jschell1-Aug-11 8:17
jschell1-Aug-11 8:17 
GeneralRe: SOCKET : How to gracfully stop application when recv() function is blocking Pin
pandit841-Aug-11 19:34
pandit841-Aug-11 19:34 
QuestionCRichEditCtrl Font Formating Pin
yurii_leorda30-Jul-11 15:11
yurii_leorda30-Jul-11 15:11 
AnswerRe: CRichEditCtrl Font Formating Pin
Code-o-mat30-Jul-11 22:21
Code-o-mat30-Jul-11 22:21 
GeneralRe: CRichEditCtrl Font Formating Pin
yurii_leorda31-Jul-11 0:21
yurii_leorda31-Jul-11 0:21 
GeneralRe: CRichEditCtrl Font Formating Pin
Code-o-mat31-Jul-11 0:37
Code-o-mat31-Jul-11 0:37 
QuestionRuntime Error in Visual Studio [modified] Pin
AndrewG123129-Jul-11 12:09
AndrewG123129-Jul-11 12:09 
AnswerRe: Runtime Error in Visual Studio Pin
Richard Andrew x6429-Jul-11 13:07
professionalRichard Andrew x6429-Jul-11 13:07 
GeneralRe: Runtime Error in Visual Studio Pin
AndrewG123129-Jul-11 13:20
AndrewG123129-Jul-11 13:20 
GeneralRe: Runtime Error in Visual Studio Pin
Richard Andrew x6429-Jul-11 13:36
professionalRichard Andrew x6429-Jul-11 13:36 
GeneralRe: Runtime Error in Visual Studio Pin
AndrewG123129-Jul-11 14:24
AndrewG123129-Jul-11 14:24 
QuestionTaskbar button text [modified] Pin
kartikdasani29-Jul-11 2:24
kartikdasani29-Jul-11 2:24 
AnswerRe: Taskbar button text Pin
Richard MacCutchan29-Jul-11 2:34
mveRichard MacCutchan29-Jul-11 2:34 
AnswerRe: Taskbar button text Pin
«_Superman_»29-Jul-11 3:19
professional«_Superman_»29-Jul-11 3:19 
AnswerRe: Taskbar button text Pin
Richard MacCutchan29-Jul-11 6:54
mveRichard MacCutchan29-Jul-11 6:54 
Questionfunction header temporary variable Pin
LionAM29-Jul-11 0:37
LionAM29-Jul-11 0:37 
Hello!
Is it part of the C++ standard that a temporary variable instantiated in the function header is destroyed after a possible assignment operation, so that the following code can be used safely:
C++
class Obj
{
    //...
};

Obj& function(Obj& temp = Obj())
{
    return temp;
}

int main()
{
    Obj myObj;
    myObj = function();

    //...

    return 0;
}

In VC++ 2008, this works as expected. In contrast, when the object is instantiated in the function body, it is destroyed before the assignment operator - so this code is not valid:
C++
Obj& function()
{
    Obj temp = Obj();
    return temp;
}

Thank you in advance.

Alex
AnswerRe: function header temporary variable Pin
barneyman29-Jul-11 1:29
barneyman29-Jul-11 1:29 
GeneralRe: function header temporary variable Pin
LionAM29-Jul-11 3:03
LionAM29-Jul-11 3:03 
Questionoverloading operator<<() vs. namespaces Pin
Michal Kaut28-Jul-11 23:46
Michal Kaut28-Jul-11 23:46 
AnswerRe: overloading operator<<() vs. namespaces Pin
Rick York31-Jul-11 7:02
mveRick York31-Jul-11 7:02 
GeneralRe: overloading operator<<() vs. namespaces Pin
Michal Kaut31-Jul-11 22:32
Michal Kaut31-Jul-11 22:32 
GeneralRe: overloading operator<<() vs. namespaces Pin
Rick York3-Aug-11 12:36
mveRick York3-Aug-11 12:36 
QuestionMapping of file Pin
sarfaraznawaz28-Jul-11 21:42
sarfaraznawaz28-Jul-11 21:42 
AnswerRe: Mapping of file Pin
«_Superman_»29-Jul-11 3:37
professional«_Superman_»29-Jul-11 3:37 

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.