cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Returning an Array
Returning an Array
Apr 5, 2012 at 1:44am UTC
dheredhere
(15)
Hey guys,
I have to write a function that generates a 3 x 3 matrix.
Generating the matrix is simple enough but i can't figure out how to return a 2d array.
Can someone explain to me if this is possible?
Thanyou!
Apr 5, 2012 at 1:49am UTC
Cubbi
(4774)
create a Matrix class (or use one from a well-known library, such as boost or eigen), and return an object. If you're creating your own, it can hold a 2D array as a member, or a 1D array or a vector or a valarray, or whatever you like.
Topic archived. No new replies allowed.