Is it possible to return an array, or more then one variable from a function?
Thanks,
Nathan
Is it possible to return an array, or more then one variable from a function?
Thanks,
Nathan
No. However, you can return a pointer to an array (but note that the array cannot be local to the function) or you can return a struct that consists of multiple values.Is it possible to return an array, or more then one variable from a function?
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
95% of the cases when "you want to return an array", what should REALLY happen is that you pass an array INTO the function, and use the passed in array to fill in the data.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.