Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- void foo(int &, int);
- ////////////////////////////////////////////////////
- int main() //
- {
- int a = 2,
- b = 5;
- printf("address a = %d \n", &a);
- printf("address b = %d \n", &b );
- foo(a, b);
- }
- ///////////////////////////////////////////////////
- void foo(int &a, int b)
- {
- printf("address &a = %d \n", &a);
- printf("address b = %d \n", &b );
- }
- //printf("a = %d, b = %d \n", a, b);
- /*
- #include <stdio.h>
- // 1) Функция swap()
- int arr[10] = {2, 5, 11, -8, 444, 66, 9, 18, 111, 1};
- int size = 10; // Размер массива или кол-во элементов
- void swap(int &a, int &b);
- ////////////////////////////////////////////////////
- int main() //
- {
- swap(arr[0], arr[1]);
- printf("arr[0] = %d, arr[1] = %d \n", arr[0], arr[1]);
- }
- ////////////////////////////////////////////////////
- void swap(int &a, int &b) //
- {
- printf("a = %d, b = %d \n", a, b);
- int buf = a;
- a = b;
- b = buf;
- printf("a = %d, b = %d \n", a, b);
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement