Click here to Skip to main content
15,850,103 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Where I can learn about using wsprintf? Pin
Joe Woodbury26-Jul-18 18:45
professionalJoe Woodbury26-Jul-18 18:45 
GeneralRe: Where I can learn about using wsprintf? Pin
GESY27-Jul-18 5:05
GESY27-Jul-18 5:05 
GeneralRe: Where I can learn about using wsprintf? Pin
GESY27-Jul-18 5:07
GESY27-Jul-18 5:07 
AnswerRe: Where I can learn about using wsprintf? Pin
Richard MacCutchan26-Jul-18 23:13
mveRichard MacCutchan26-Jul-18 23:13 
QuestionReturn nothing from a function having return type Pin
meerokh26-Jul-18 1:40
meerokh26-Jul-18 1:40 
AnswerRe: Return nothing from a function having return type Pin
Richard MacCutchan26-Jul-18 2:28
mveRichard MacCutchan26-Jul-18 2:28 
GeneralRe: Return nothing from a function having return type Pin
Member 1392860827-Jul-18 12:43
Member 1392860827-Jul-18 12:43 
GeneralRe: Return nothing from a function having return type Pin
Richard MacCutchan27-Jul-18 22:54
mveRichard MacCutchan27-Jul-18 22:54 
I don't understand what you are saying. If the return type of your getPackage function is a Package object, then that is what you must return. If the function fails then you must find some other way to signal that failure, perhaps by throwing an exception. If you want the possibility of returning nullptr to indicate failure, then the function must return a pointer to a Package object, thus:
C++
Package* getPackage()
{
    Package* pPackage;

    // code to create a new package ...
    pPackage = new Package();
    // ...
    if (some problem with creating the object)
        pPackage = nullptr;

    return pPackage;
}

AnswerRe: Return nothing from a function having return type Pin
Jochen Arndt26-Jul-18 2:48
professionalJochen Arndt26-Jul-18 2:48 
AnswerRe: Return nothing from a function having return type Pin
Joe Woodbury26-Jul-18 6:44
professionalJoe Woodbury26-Jul-18 6:44 
QuestionNo Errors but wrong values on return? Pin
GESY25-Jul-18 17:02
GESY25-Jul-18 17:02 
AnswerRe: No Errors but wrong values on return? Pin
Victor Nijegorodov25-Jul-18 21:52
Victor Nijegorodov25-Jul-18 21:52 
GeneralRe: No Errors but wrong values on return? Pin
GESY26-Jul-18 8:58
GESY26-Jul-18 8:58 
GeneralRe: No Errors but wrong values on return? Pin
Victor Nijegorodov26-Jul-18 9:20
Victor Nijegorodov26-Jul-18 9:20 
GeneralRe: No Errors but wrong values on return? Pin
GESY27-Jul-18 4:55
GESY27-Jul-18 4:55 
AnswerRe: No Errors but wrong values on return? Pin
Richard MacCutchan26-Jul-18 0:42
mveRichard MacCutchan26-Jul-18 0:42 
GeneralRe: No Errors but wrong values on return? Pin
GESY26-Jul-18 8:56
GESY26-Jul-18 8:56 
QuestionRe: No Errors but wrong values on return? Pin
David Crow26-Jul-18 18:11
David Crow26-Jul-18 18:11 
GeneralRe: No Errors but wrong values on return? Pin
Richard MacCutchan26-Jul-18 23:08
mveRichard MacCutchan26-Jul-18 23:08 
SuggestionRe: No Errors but wrong values on return? Pin
David Crow26-Jul-18 18:14
David Crow26-Jul-18 18:14 
GeneralRe: No Errors but wrong values on return? Pin
GESY27-Jul-18 5:02
GESY27-Jul-18 5:02 
GeneralRe: No Errors but wrong values on return? Pin
GESY27-Jul-18 5:49
GESY27-Jul-18 5:49 
AnswerRe: No Errors but wrong values on return? Pin
David Crow27-Jul-18 5:53
David Crow27-Jul-18 5:53 
AnswerRe: No Errors but wrong values on return? Pin
Richard MacCutchan27-Jul-18 2:13
mveRichard MacCutchan27-Jul-18 2:13 
GeneralRe: No Errors but wrong values on return? Pin
GESY27-Jul-18 4:58
GESY27-Jul-18 4: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.