Functions in C++ can return multiple values using ______.

  • Pointers
  • References
  • Tuples
  • Arrays
Functions in C++ can return multiple values using tuples. A tuple is an ordered collection of elements, and it's an excellent way to return multiple values from a function. It's more flexible than returning values using pointers, references, or arrays, as it allows you to return values of different types. Tuples were introduced in C++11.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *