Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

return function in cpp

// Single return at end often improves readability.
int max(int a, int b) {
    int maxval;
    if (a > b) {
        maxval = a;
    } else {
        maxval = b;
    }
    return maxval;
}//end max
Source by www.fredosaurus.com #
 
PREVIOUS NEXT
Tagged: #return #function #cpp
ADD COMMENT
Topic
Name
3+7 =