search
Login

Categories


C Books Guide and List
C++ Books Guide and List
Best Java Books

3.8k questions

4k answers

117 comments

10.7k users

1 vote
120 views
asked anonymous
edited by

2 Answers

0 votes
yes and no, you can't return more than one variable / object, but as you suggest, you can put them into an array and return that, there is no limit to the nesting of arrays so you can just package them up that way to return
answered Sr Member 3.2k points 6 13 28
0 votes
You can always only return one variable which might be an array. But You can change global variables from inside the function. That is most of the time not very good style, but it works. In classes you usually change class varbiables from within functions without returning them.
answered Sr Member 4k points 5 11 21

Related questions

0 votes
1 answer 68 views
68 views
asked rajesh Guru 39.1k points 10 21 33
0 votes
1 answer 1K views
1K views
What is the return value from printf() function?
asked carlton Sr Member 4k points 5 11 21
2 votes
4 answers 4.2K views
0 votes
1 answer 21 views
0 votes
1 answer 14 views
...