#Returning 2 variables

25 messages · Page 1 of 1 (latest)

plain wadiBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.

elder zealot
#

there are a couple of options

dull inlet
#

This guy asked the same question like 30 mins ago and got the answer.

elder zealot
#

you can return a single object containing both
or you can use outparameters
or I guess globals if you want but dont do that

dull inlet
#

it looks like he removed the post or it was removed by someone else

elder zealot
#

welp I answered it

dull inlet
elder zealot
#

weird

dull inlet
#

this might be a troll account

elder zealot
#

well its an interesting troll

#

giving a trival question which can be answered in a single message

harsh walrus
#

no, it's actually that I've tried to reformulate the question but none of you actually gave me an understandable answer I'm a begginer so it's quite difficult for me but it's ok, I'll do it by myself and no, I'm not a troll

nimble parrot
#

just return a struct that contains both values.

dull inlet
#

What do you want us to explain exactly, because rn it is guessing.

verbal shadow
cedar otter
#

what is the difference between function and std::pair

dull inlet
#

they have nothing in common

#

std::pair is a pair of values and function is a piece of code

verbal shadow
cedar otter
dull inlet
#

a function returning pair or Point

#

pair is a data type