i want to write a function to which i need to pass two matrices and get the sum and product of them as output. but how can i return more than one matrix from a function? (i want to pass and return using pointers)

## Recommended Answers

Jump to PostCreate a structure that holds two arrays and pass back the structure.

Jump to Post`int matrix_ops(matrix * m1, matrix * m2, matrix * sum, matrix * pdt)`

Where

`sum`

and`pdt`

are empty matrices to be filled in within the function.

## All 6 Replies

Momerath
1,327
Nearly a Senior Poster
Featured Poster

L7Sqr
227
Practically a Master Poster

vineeshvs
0
Light Poster

L7Sqr
227
Practically a Master Poster

vineeshvs
0
Light Poster

Akash Saikia
9
Junior Poster

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.