Skip to content

Instantly share code, notes, and snippets.

@jfpoole
Created October 13, 2019 20:06
Show Gist options
  • Save jfpoole/e19455c7192e07ad393610ec46b657ed to your computer and use it in GitHub Desktop.
Save jfpoole/e19455c7192e07ad393610ec46b657ed to your computer and use it in GitHub Desktop.
#include <stdio.h>
void update(int* variable)
{
*variable = *variable * 2;
}
int main(int, char**)
{
int a = 1;
int b = 2;
int c = 3;
printf("a = %d, b = %d, c = %d\n", a, b, c);
update(&a);
update(&b);
update(&c);
printf("a = %d, b = %d, c = %d\n", a, b, c);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment