Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // HomeWork(pointer).cpp :
- //
- #include <iostream>
- using namespace std;
- int main()
- {
- const int Size = 9;
- int arr[Size] = { 1,2,3,4,5,6,7,8,9 };
- int* pa;
- int tmp = 0;
- tmp = arr[0];
- for (int i = 0; i < Size - 1; ++i)
- {
- pa = &arr[i];
- arr[i] = *(pa + 1);
- }
- arr[Size - 1] = tmp;
- for (int i = 0; i < Size; ++i)
- {
- cout << arr[i] << endl;
- }
- }
Add Comment
Please, Sign In to add comment