<div dir="ltr"><div><div><div><div>Hi,<br></div>Thanks for your great support. <br>I am developing my code in c++ and I have created 4 matrices in a function and they are work fine.<br>In the end of the function I need to delete them to release the memory space they occupied.<br></div><div><ul><li>My question:</li></ul></div><div><div style="margin-left:40px">However, I need to pass these matrices to other functions (or another class) and use their contents before I destroy them in the current function.<br></div><br>(I need it because now I have a long function and I want to make it smaller. Also I need to make a recursive function that gets matrices as input.)<br><br></div></div>I was thinking of using a pointer to the beginning of each of them, but I am not very good at this. Also I am worried about how I destroy them.<br><br></div><div>Would you please let me know what is the best approach for this?<br><br></div><div>Best,<br></div><div>Ehsan<br></div><br></div>