returning multiple values

in a function how do you return multiple values to the main function.
closed account (S6k9GNh0)
A tuple or struct instance.
implementation?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
struct MultipleVar
{
      int val1;
      string val2;
      double val3;
};

MultipleVar Function(void)
{
     MultipleVar Ret;
     Ret.val1 = 42;
     Ret.val2 = "Empty";
     Ret.val3 = 2.718281828459;
     
     return Ret;
}


http://www.cplusplus.com/doc/tutorial/structures/
Last edited on
thank you
Topic archived. No new replies allowed.