Created
November 11, 2010 13:22
-
-
Save sayz/672492 to your computer and use it in GitHub Desktop.
This file contains 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
#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