Created
April 16, 2013 04:01
-
-
Save MosheBerman/5393250 to your computer and use it in GitHub Desktop.
An example where we return the value received by the wrapper function.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Prototypes */ | |
int sum(int, int); | |
int wrapper(int, int); | |
/* Main program */ | |
int main() | |
{ | |
int x = wrapper(1,1); // We pass in the two values instead. | |
return 0; | |
} | |
/* Program definition */ | |
int wrapper(int xToAdd, int yToAdd){ | |
return sum(xToAdd, yToAdd); // z will become 2 here | |
} | |
int sum(int x, int y) | |
{ | |
return x+y; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment