A
A
Andrey Zhidenko2016-03-17 14:47:17
C++ / C#
Andrey Zhidenko, 2016-03-17 14:47:17

How to pass an array unchanged outside the current class?

When the button is pressed, the following happens:

gaussM = new Gauss(matrix, this);
luDecom = new luDec(matrix, this);
gaussM.solvingGauss();
luDecom.startLU();

The problem is that I want to pass the same matrix array to the luDec object as to the gaussM object, but certain operations occur inside the solvingGauss method of the Gauss class object, and after executing this method, my matrix array looks different, but I performed operations with an array inside another class with its local variable, not with the matrix array inside the form class. How to solve it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Kovalsky, 2016-03-17
@jamguranga

Клонировать объект. А заодно разобраться по шагам как у вас ссылки на объекты проставляются. "Оно само, я не трогал" не бывает.
Как вариант - переделать matrix в структуру если это возможно и не создаст других багов.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question