So, it is necessary to transfer object by argument. I passed it, but in the method one field of the object should change. But after performing the method, it does not change. What to do here? Here is the code
void adding(MainC *MainCobj) { //2+1 ->3 if (MainCobj->n > MainCobj->m) k = n; else k = m; for (i = 0;i < k;i++) { MainCobj->c = MainCobj->a + MainCobj->b; } cout << "adding:" << c[1]<<endl; cout << "cc=" << MainCobj->c[1]<<endl;//cc= Это для проверки добавления }
MainC? Create a minimal example that reproduces the error, then perhaps you will be helped faster. - αλεχολυτ