Function() { x = 0; y = 0; } virtual double Calculation (int) = 0;// базовый virtual double Calculation(int t) производный { y = exp(t); x = 2 * exp(t); return ; } both x and y must be returned immediately.
Function() { x = 0; y = 0; } virtual double Calculation (int) = 0;// базовый virtual double Calculation(int t) производный { y = exp(t); x = 2 * exp(t); return ; } both x and y must be returned immediately.
General options for returning multiple values - through the structure or by reference.
For example, in your version you can use the standard pair structure:
pair<double,double> Calculation(double t) { pair<double,double> result; result.first = exp(t); result.second = 2 * exp(t); return result; } Or by reference:
void Calculation(double t, double& x, double& y) { y = exp(t); x = 2 * exp(t); } well, in the code - something like
double x, y; obj.Calculation(3,x,y); Source: https://ru.stackoverflow.com/questions/658984/
All Articles
std::tuple- Flowneee