# Tasks and Solutions: A pointer to a pointer

1) Create a two-dimensional array of 5x5, fill it with random numbers from 10 to 99 and display. Swap the maximum element of each row with the first element in the corresponding row. The problem solved by the pointer.

2) The challenge for the multiplication of matrices. The user arbitrarily sets the dimension of the two arrays and fills the values ​​manually. Do not forget, that it is necessary to allocate the appropriate memory locations for matrices, that the user will fill in for the final third of the matrix. Next, display on the screen, both the matrix and filled the resulting matrix (their play).

Maybe someone knows, how to multiply matrices. Watch this short video (author: Prihodovsky MA)

To support our site – click on the piggy bank and choose any convenient way.

Tasks and Solutions: A pointer to a pointer

## 8 thoughts on “Tasks and Solutions: A pointer to a pointer”

1. Mikhail Belousov says:

1. Mikhail Belousov says:

d / s on 2nd Tasks))

2. Nomin says:

You are wrong to rid the memory of the second task, after a != c. When you enter the matrix 3×2 and 2×3 gives an error message.
For the second array to do a separate cycle, and the first and the third may be one in.

3. user says:

heh, The first task is solved much trivialnee, than is required in the job.. :]]

4. Vanda says:

Decided Zadachu№1 using pointers in the search for the maximum value. Prokomentirujte please can you do that and how much it is validly?
P.S.: sorri, I'm still just learning, so this question ))

5. Ivan says:

too awful?

6. Teddy Bear says:

I sdelyal. :) The solution is different from yours, but the program should work correctly, several times I checked.

7. Victor says:

Correct me, but at the end of the second task, where the memory is freed, incorrectly accounted array sizes, which leads to an error, tk. Quantity M2 series (i in the cycle) must be < with.