C
C#3y ago
Adetu

Functions

I'm wandering if it's possible to get a function to return more than one value of different data types.
7 Replies
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Adetu
AdetuOP3y ago
I'm not sure how to syntax to get multiple values out the function
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
dancepanda42
dancepanda423y ago
Or Just create a "container"/model class as return type
Adetu
AdetuOP3y ago
I managed to do it I called the 3 datatypes of the values I return at the beginning of my function with brackets im testing to see how it works now Works perfect thanks for this... I just couldn't get my head around the syntax Plus I couldn't find examples of people returning multiple values from a function
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Adetu
AdetuOP3y ago
I did: (string, int, int) userLocation() return (fLocation ,fRisk ,fKillPotential); (location, risk, killPotential) = userLocation(); and it worked
Want results from more Discord servers?
Add your server