Raised This Month: $ Target: $400
 0% 

Letting an optional parameter die?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
tenub
Junior Member
Join Date: Aug 2013
Old 05-17-2016 , 22:20   Letting an optional parameter die?
Reply With Quote #1

I wish to call this function with or without a second parameter. With it, I care about setting its value and would be able to test the value of the message from an outside function. Without it, I don't care and would simply like the return value (which will be returned in either case and is an integer, respType):

PHP Code:
stock parse_resp_data(data[], message[] = 0)
{
    new 
respTypeerror[512], errorSize sizeof(error);

    if (!
strlen(message))
    {
        new 
message[512];
    }

    switch (
data[0])
    {
        case 
'+': { respType parse_resp_simple_string(data[1], message); }

        ...

    }

    return 
respType;

Is this possible?
tenub is offline
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:33.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode