Thank you for that link. Yeah I thought about using vector but need to change code in several places. Anyway I will make it constant integer literal and test the code. Do you have any idea why it runs in C though?
@Hosch250 m and n are initialised during compilation that's not an issue. The code compiles fine in C. The error is the following "error: cannot initialize a parameter of type 'int ()[]' with an lvalue of type 'int (*)[n]"