Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- #include <conio.h>
- using namespace std;
- void change(int *arr, int n, int val)
- {
- int* pointer = &arr[n-1];
- *pointer = val;
- }
- int main()
- {
- const int SIZE = 5;
- int array[SIZE];
- int n;
- int val;
- for(int i = 0; i < 5; i++)
- cin >> array[i];
- cin >> n;
- cin >> val;
- change(array, n, val);
- for(int i = 0; i < 5; i++)
- cout << array[i];
- _getch();
- return 0;
- }
Add Comment
Please, Sign In to add comment