Skip to content

Instantly share code, notes, and snippets.

@MosheBerman
Last active December 16, 2015 06:39
Show Gist options
  • Save MosheBerman/5393214 to your computer and use it in GitHub Desktop.
Save MosheBerman/5393214 to your computer and use it in GitHub Desktop.
An example where we wrap a sum(int, int) call in a wrapper function.
/* Prototypes */
int sum(int, int);
void wrapper(int, int);
/* Main program */
int main()
{
wrapper(1,1); // We pass in the two values instead.
return 0;
}
/* Program definition */
void wrapper(int xToAdd, int yToAdd){
int z = 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