Skip to content

Instantly share code, notes, and snippets.

@dmbaturin
Created September 27, 2012 18:51
Show Gist options
  • Save dmbaturin/3795705 to your computer and use it in GitHub Desktop.
Save dmbaturin/3795705 to your computer and use it in GitHub Desktop.
#include <stdio.h>
void swap(int* a, int* b)
{
int tmp = *a;
*a = *b;
*b = tmp;
}
int main(void)
{
int a = 10;
int b = 20;
swap(&a, &b);
printf("%d %d\n", a, b);
return(0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment