Return array | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 1

Return array

int (&fillarr(int (&arr) [5] ))[5] { return arr;} Can somebody explain how this code works, I was searching for how to return an array in a function and I got this

1st Apr 2020, 9:16 PM
Zohal
Zohal - avatar
3 Réponses
0
Have you verified the validity of the code? Idk but I think it has too many parentheses, and there's only `return arr;` in the function body. Why not use vector? it will be a lot easier.
1st Apr 2020, 11:47 PM
Ipang
0
Ipang I used vector in my code but it has a max size limit and didnt work for really big inputs
1st Apr 2020, 11:53 PM
Zohal
Zohal - avatar
0
What did you mean max size limit? vector is dynamic container and is very capable for holding large amount of data. Share your code?
2nd Apr 2020, 12:35 AM
Ipang