- #1
CAF123
Gold Member
- 2,948
- 88
Say I have a function `func` that does a certain task, returning some expression `exp`. Can I use this expression in another function without having to call `func` again, which I suppose will redo all the steps needed to derive `exp` in the first place?
E.g
Now, I want to use exp in another function, but without calling `func`, like
Thanks! I did not use C++ much before so probably it's a naive question...
E.g
Code:
double func() {
...code...
return exp
}
Code:
double newfunc(double exp) {
...code ...
}
Thanks! I did not use C++ much before so probably it's a naive question...