First, you have to get rid of the circular includes (look it up), probably by removing both and replacing them with foward declarations. Second, every function parameter where you accept a vector/matrix by value, you should probably accept by a const reference instead. Third, unless your goal is to practice manual memory management, get rid of the raw pointers and
new
/malloc
calls, and use std::vector
or std::unique_ptr
instead. (Or, if you do want to practice doing it manually, you must write destructors and copy/move constructors/assignments, otherwise your code is leaking memory).