Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int ****AllocationFunction(int &row, int &column)
- {
- cout << "Input the amount of rows: ";
- cin >> row;
- cout << "\nInput the amount of columns: ";
- cin >> column;
- int**** s = new int***;
- *s = new int**;
- **s = new int*[row];
- int *t = ***s;
- int ** v = **s;
- for (int i = 0; i < row; ++i)
- (**s)[i] = new int[column];
- //for (int row = 0; row < row; ++row)
- //for (int column = 0; column < column; ++row)
- //(*s)[row][column] = 0;
- return s;
- }
- void InputFunction(int ****s, int &row, int &column)
- {
- // ugly fix this
- for (int i = 0, x = 0; i < column && x < row; i++)
- {
- cin >> (**s)[x][i];
- cout << (**s)[x][i];
- if (i == column - 1)
- {
- x++;
- i = -1;
- }
- }
- }
- void ReverseFunction()
- {
- }
- void DisplayFunction()
- {
- }
- void DeallocateFunction(string ***, size_t&)
- {
- }
- int main()
- {
- int row = 0;
- int column = 0;
- // is there a better way?
- InputFunction(AllocationFunction(row, column),row, column);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement