Compare Matrices - имам ли memory leak в задачата
Write a program that reads two integer matrices (2D arrays) from the console and compares them element by element.
You are not allowed to use STL.
For better code reusability, you could do the comparison in a function, which returns true if they are equal and false if not.
Each matrix definition on the console will contain a line with a positive integer number R – the number of rows in the matrix – followed by R lines containing the numbers in the matrix, separated by spaces (each line will have an equal amount of numbers.
The matrices will have at most 10 rows and at most 10 columns.
Print equal if the matrices match, and not equal if they do not match.
https://pastebin.com/8XPK8DUW
Въпросът ми е: правилно ли освобождавам паметта във функцията за четене на двумерен масив? Или по скоро, ако не освобождавах паметта на едномерния масив във функцията щях ли да имам memory leak?
Благодаря за забележката!