This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
multiple_return_values [2019/04/19 21:20] – korshun | multiple_return_values [2019/04/19 21:22] – korshun | ||
---|---|---|---|
Line 11: | Line 11: | ||
int newX = r1; | int newX = r1; | ||
int newY = r2; | int newY = r2; | ||
- | </ | ||
- | |||
- | The following is also valid: | ||
- | < | ||
- | RotateVector(x, | ||
- | x = r1; | ||
- | y = r2; | ||
- | </ | ||
- | |||
- | '' | ||
- | < | ||
- | normalize3d(x, | ||
- | int newX = r1; | ||
- | int newY = r2; | ||
- | int newZ = r3; | ||
</ | </ | ||
Line 47: | Line 32: | ||
</ | </ | ||
</ | </ | ||
+ | |||
+ | But overwriting argument variables immediately after calling the function is valid: | ||
+ | < | ||
+ | RotateVector(x, | ||
+ | x = r1; | ||
+ | y = r2; | ||
+ | </ | ||
+ | |||
+ | An example of a function returning three values: | ||
+ | < | ||
+ | normalize3d(x, | ||
+ | int newX = r1; | ||
+ | int newY = r2; | ||
+ | int newZ = r3; | ||
+ | </ | ||