Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

When I compile this program, it completely ignores my input function and I have

ID: 3527571 • Letter: W

Question

When I compile this program, it completely ignores my input function and I have a feeling it has to do with how I am calling the function but I do not know how to fix it. Any help would be greatly appreciated! #include using namespace std; void alloc(int **, int, int); void input(int **, int, int); int main() { int **s = nullptr, r = 0, c = 0; alloc(s, r, c); input(s, r, c); cin.ignore(); cout << endl << "Program Over" << endl; cout << "Press Enter to end --> "; cin.get(); return 0; } void alloc(int **assign, int rows, int cols) { int count = 1, i; cout << "How many rows should the array have --> "; cin >> rows; cout << endl << "How many columns should the array have --> "; cin >> cols; assign = new int*[rows]; for(i = 0; i < rows; i++) { assign[i] = new int[cols]; } } void input(int **in, int j, int k) { int count = 1, i, l; for(i = 0; i < j; i++) { cout << endl << "For row " << count << " enter " << k << " values separated by spaces --> "; count++; for(l = 0; l < k; l++) { cin >> *(*(in + i) + l); } } for (i = 0; i < j; i++) { cout << "For row " << count << " here are the values in the array:" << endl; count++; for (l = 0; l < k; l++) { cout << *(*(in + i) + l) << " "; } cout << endl; } }

Explanation / Answer

try this code this is working.. please do rate #include using namespace std; void alloc(int **, int, int); void input(int **, int, int); int main() { int **s = NULL, r = 0, c = 0; alloc(s, r, c); cin.ignore(); cout
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote