Click here to Skip to main content
15,921,226 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I saw these while I was learning about vectors, where they define the type of variables in the vector.
I thought that it might help with functions.

btw.
Is there a way for a function to return multiple variable types?

What I have tried:

I can't find anything describing this.
Posted
Updated 23-Feb-17 10:15am
v2
Comments
[no name] 23-Feb-17 13:49pm    
"I can't find anything describing this", uhm... describing what? How to return multiple variable types? Yes, you use pointers.

 
Share this answer
 
Comments
Maciej Los 23-Feb-17 14:53pm    
An idiot's guide beat me!
Graeme_Grant 23-Feb-17 16:15pm    
It amazes me how they can use Google Search to find the CodeProject Q&A to ask these questions yet can't use it to research for a solution to this stuff... go figure...
Quote:
Is there a way for a function to return multiple variable types?
Yes, if I got you: a template function may do that. See, for instance: Function template - cppreference.com[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900