Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- void go(int *p1, int *p2);
- /////////////////////////////////////////////////////////////////////////////////
- int main()
- {
- int mas[10]={ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
- int nArr[10]={101,102,103,104,105,106,107,108,109,110};
- go(mas, nArr);
- printf("mas = ");
- for(int i = 0; i < 10; i++) printf("%d, ", mas[i]);
- printf("\nnArr = ");
- for(int i = 0; i < 10; i++) printf("%d, ", nArr[i]);
- }
- /////////////////////////////////////////////////////////////////////////////////
- void go(int *p1, int *p2)
- {
- int n; // Âðåìåííîå õðàíåíèå
- for(int i = 0; i < 10; i++)
- {
- n = p1[i];
- p1[i] = p2[i];
- p2[i] = n;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement