Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void AllocationFunction(int ****&s, int *&t, int *&v, int **&u, int &row, int &column)
- {
- s = new int***;
- *s = new int**;
- **s = new int*[row];
- u = new int*;
- while (row < 2)
- {
- cout << "How many rows should the array have <at least 2> --> ";
- cin >> row;
- if (row >= 2 && column < 2)
- {
- cout << "How many columns should the array have <at least 2> --> ";
- cin >> column;
- }
- }
- for (int i = 0; i < row; ++i)
- (**s)[i] = new int[column];
- }
- void InputFunction(int ****&s, int *t, int *v, int **u, int &row, int &column)
- {
- for (int i = 0, x = 0, z = 1; i < column && x < row; i++)
- {
- if (i == 0)
- cout << "\nFor row " << z << " enter " << column << " values seperate by spaces --> ";
- cin >> (*(*(**s + x) + i));
- if (i == column - 1)
- {
- z++;
- x++;
- i = -1;
- }
- }
- }
- void ReverseFunction(int ****s, int *t, int *v, int **u, int row, int column)
- {
- }
- void DisplayFunction(int ****s, int *t, int *v, int **u, int row, int column)
- {
- for (int i = 0; i < column; i++)
- {
- cout << **s[0][i];
- }
- }
- void DeallocateFunction(int ****s, int *t, int **v)
- {
- }
- int main()
- {
- int row = 0;
- int column = 0;
- int**** s = nullptr;
- int * t = nullptr;
- int ** u = nullptr;
- int * v = nullptr;
- AllocationFunction(s, t, v, u, row, column);
- InputFunction(s, t, v, u, row, column);
- DisplayFunction(s, t, v, u, row, column);
- //ReverseFunction(s, t, v, u, row, column);
- //DisplayFunction(s, t, v, u, row, column);
- //DeallocateFunction(s, t, u, v);
- //ReverseFunction(InputFunction(AllocationFunction(s, t, v, row, column),row, column),row, column);
- }
Advertisement
Add Comment
Please, Sign In to add comment