Skip to content

Instantly share code, notes, and snippets.

@sayz
Created November 11, 2010 13:22
Show Gist options
  • Save sayz/672492 to your computer and use it in GitHub Desktop.
Save sayz/672492 to your computer and use it in GitHub Desktop.
#include <stdio.h>
void ptakas(int *x, int *y)
{
int t;
t = *x;
*x = *y;
*y = t;
}
void takas(int x, int y)
{
int t;
t = x;
x = y;
y = t;
}
int main(void)
{
int a, b;
a = 7;
b = 19;
printf("normal takas\n");
takas(a, b);
printf("a degeri : %d\n", a);
printf("b degeri : %d\n", b);
printf("pointer takas\n");
ptakas(&a, &b);
printf("a degeri : %d\n", a);
printf("b degeri : %d\n", b);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment