Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- void zamien_wartosci(int* x, int* y){
- int tmp;
- tmp = *x;
- *x = *y;
- *y = tmp;
- }
- int main() {
- int a = 8, b = 16;
- printf("Przed zamiana\n");
- printf("a = %2d, b = %2d\n", a, b);
- zamien_wartosci(&a, &b); // nie dziala tak jak bysmy chcieli!
- printf("Po zamianie\n");
- printf("a = %2d, b = %2d\n", a, b);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement