matrix | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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

2nd Jun 2019, 5:01 AM
Night_fury~
Night_fury~ - avatar
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. ).
2nd Jun 2019, 5:34 AM
Michail Getmanskiy
Michail Getmanskiy - avatar