+ 15
matrix
Is their some other way to get input in a 2D array to form a matrix ? https://code.sololearn.com/ckaN3Q7ST7y7/?ref=app
1 Answer
+ 3
1. You can save more than one variant of the matrix data in variables (constants) of your code. Give the user a choice of options in the input field.
2. You can generate random values of matrix with have size (Width, Hight) from input user values.
3. You can input matrix data from input stream.
In all cases, except for the matrix variant in the code, the array will need to be created (and destroyed) over time. This can be done both through the simple creation of a new array (object or class, using the new [] method) each time (without forgetting to delete it, using the delete [] method), or with the help of the malloc (...), free (..) functions. ).