+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

6/2/2019 5:01:23 AM

Night_fury~

2 Answers

New Answer

+4

Night_fury~ Enter the data in the following form 2 (size of matrix) 1 2 // elements for each row 3 4 (submit)

+2

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. ).