Developer community
+1 vote
118 views
asked by
edited by | 118 views

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 by Sr Member (3.2k points) 6 13 27
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 by Sr Member (4k points) 5 11 21

Related questions

0 votes
1 answer
asked by rajesh Guru (39.1k points) 10 22 33 | 63 views
0 votes
1 answer
asked by carlton Sr Member (4k points) 5 11 21 | 1k views
+2 votes
4 answers
0 votes
1 answer
asked by kelly johnes Advisor (6.3k points) 5 21 30 | 20 views
0 votes
1 answer
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

Categories


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

3.8k questions

4k answers

117 comments

10.7k users

3,751 questions
4,046 answers
117 comments
10,709 users