C++ warning in function
LoveFromSkyy

Good morning!

My function consists of 2 global variables coins and XP


In case you are wondering what this function does, I'll explain.


The function is made for after the player wins the level. When this happens, they gain XP and coins. For some reason, the program is giving me a warning on the return value XP


The function:

How can I fix this?
The warning is at return XP, coins;


An extra favor?

I don't want my game to only drop a certain amount of coins or give only 100 XP every single level. How can I change this to be random between a certain amount of numbers?

(if you answer both, i will select your explanation as the answer to this question)
;)
Thank you

I am not including the entire program due to other possible errors that i may be fixing while awaiting the answer to this question

You are viewing a single comment. View All
Answered by xxpertHacker [earned 5 cycles]
View Answer
AntarcticaAdv

It is not possible to return multiple values, you can wrap the elements in a tuple if you want to return multiple values, like this:

Here are the docs if you want to read more.

Edit: sorry for the lack of time, I have to get going and don't have time for the other question.

LoveFromSkyy

Thank you!
@AntarcticaAdv