How many values can be returned by a function 2024?
I'll answer
Earn 20 gold coins for an accepted answer.20
Earn 20 gold coins for an accepted answer.
40more
40more
Studied at Harvard University, Lives in Boston.
You can't return two values. However, you can return a single value that is a struct that contains two values. You can return only one thing from a function. Either you make a struct which contains all the things you want to return, or you pass some function parameters by reference.
2023-05-07 05:47:15
评论(499)
Helpful(122)
Helpful
Helpful(2)

Sophia Nguyen
QuesHub.com delivers expert answers and knowledge to you.
You can't return two values. However, you can return a single value that is a struct that contains two values. You can return only one thing from a function. Either you make a struct which contains all the things you want to return, or you pass some function parameters by reference.