Returning multiple values from a function:
Returning multiple values from a function
suggest changeThere are many situations where it is useful to return several values from a function: for example, if you want to input an item and return the price and number in stock, this functionality could be useful. There are many ways to do this in C++, and most involve the STL. However, if you wish to avoid the STL for some reason, there are still several ways to do this, including structs/classes and arrays.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents
11Loops
14keywords
17Pointers
26std::map
29std::any
38File I/O
39Streams
42Returning multiple values from a function
51Unions
56Lambdas
60SFINAE
62RAII
67Sorting
84RTTI
87Scopes
102Attributes
104Profiling
107Recursion
113Header files
117Iteration
125Alignment
133Optimization
134Semaphore
136Debugging
139Mutexes
141Unit testing
142decltype
146Contributors