+ 2

Is it possible to return a value from an array?

16th Feb 2018, 4:26 AM
Jay Jay
Jay Jay - avatar
10 Answers
+ 4
Mohammad Sanei so, you mean this can't be done naa return a[2]; i first would need to store the data from array into some variable first then return that variable
15th Aug 2018, 4:36 PM
Jay Jay
Jay Jay - avatar
+ 4
and x is not declared in main
18th Aug 2018, 10:26 AM
Jay Jay
Jay Jay - avatar
+ 3
return statement is used to explicitly return data from a method (function). It causes program control to transfer back to the caller of the method, It is categorized as a jump statement,
16th Feb 2018, 7:11 AM
Tim Millar
Tim Millar - avatar
+ 3
dont we need return value ?? what value will go in test? show me a working code please Mohammad Sanei
18th Aug 2018, 5:24 AM
Jay Jay
Jay Jay - avatar
+ 3
can you make, a working code in playground
19th Aug 2018, 4:34 AM
Jay Jay
Jay Jay - avatar