Click here to Skip to main content
14,298,321 members

C / C++ / MFC

 
GeneralRe: Where I can learn about using wsprintf? Pin
GESY27-Jul-18 4:05
memberGESY27-Jul-18 4:05 
GeneralRe: Where I can learn about using wsprintf? Pin
GESY27-Jul-18 4:07
memberGESY27-Jul-18 4:07 
AnswerRe: Where I can learn about using wsprintf? Pin
Richard MacCutchan26-Jul-18 22:13
protectorRichard MacCutchan26-Jul-18 22:13 
QuestionReturn nothing from a function having return type Pin
meerokh26-Jul-18 0:40
membermeerokh26-Jul-18 0:40 
AnswerRe: Return nothing from a function having return type Pin
Richard MacCutchan26-Jul-18 1:28
protectorRichard MacCutchan26-Jul-18 1:28 
GeneralRe: Return nothing from a function having return type Pin
Member 1392860827-Jul-18 11:43
memberMember 1392860827-Jul-18 11:43 
GeneralRe: Return nothing from a function having return type Pin
Richard MacCutchan27-Jul-18 21:54
protectorRichard MacCutchan27-Jul-18 21:54 
AnswerRe: Return nothing from a function having return type Pin
Jochen Arndt26-Jul-18 1:48
mveJochen Arndt26-Jul-18 1:48 
The common solution is to return an empty object. But this requires that the class supports such (usually by the default constructor without arguments creating such an empty object and providing a member function that checks for the object being empty).

An example is the std::string class:
std::string somefunc()
{
    // An empty string
    std::string str();
    
    // Optionally set the string here
    
    // Might return an empty string
    return str;
    // May also use 
    //return std::string();
}

std::string str = somefunc();
if (!str.empty())
{
    // String is not empty
}

AnswerRe: Return nothing from a function having return type Pin
Joe Woodbury26-Jul-18 5:44
professionalJoe Woodbury26-Jul-18 5:44 
QuestionNo Errors but wrong values on return? Pin
GESY25-Jul-18 16:02
memberGESY25-Jul-18 16:02 
AnswerRe: No Errors but wrong values on return? Pin
Victor Nijegorodov25-Jul-18 20:52
memberVictor Nijegorodov25-Jul-18 20:52 
GeneralRe: No Errors but wrong values on return? Pin
GESY26-Jul-18 7:58
memberGESY26-Jul-18 7:58 
GeneralRe: No Errors but wrong values on return? Pin
Victor Nijegorodov26-Jul-18 8:20
memberVictor Nijegorodov26-Jul-18 8:20 
GeneralRe: No Errors but wrong values on return? Pin
GESY27-Jul-18 3:55
memberGESY27-Jul-18 3:55 
GeneralMessage Closed Pin
11-Dec-18 9:03
memberMember 1408587711-Dec-18 9:03 
AnswerRe: No Errors but wrong values on return? Pin
Richard MacCutchan25-Jul-18 23:42
protectorRichard MacCutchan25-Jul-18 23:42 
GeneralRe: No Errors but wrong values on return? Pin
GESY26-Jul-18 7:56
memberGESY26-Jul-18 7:56 
QuestionRe: No Errors but wrong values on return? Pin
David Crow26-Jul-18 17:11
memberDavid Crow26-Jul-18 17:11 
GeneralRe: No Errors but wrong values on return? Pin
Richard MacCutchan26-Jul-18 22:08
protectorRichard MacCutchan26-Jul-18 22:08 
SuggestionRe: No Errors but wrong values on return? Pin
David Crow26-Jul-18 17:14
memberDavid Crow26-Jul-18 17:14 
GeneralRe: No Errors but wrong values on return? Pin
GESY27-Jul-18 4:02
memberGESY27-Jul-18 4:02 
GeneralRe: No Errors but wrong values on return? Pin
GESY27-Jul-18 4:49
memberGESY27-Jul-18 4:49 
AnswerRe: No Errors but wrong values on return? Pin
David Crow27-Jul-18 4:53
memberDavid Crow27-Jul-18 4:53 
AnswerRe: No Errors but wrong values on return? Pin
Richard MacCutchan27-Jul-18 1:13
protectorRichard MacCutchan27-Jul-18 1:13 
GeneralRe: No Errors but wrong values on return? Pin
GESY27-Jul-18 3:58
memberGESY27-Jul-18 3:58 

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.