Link to home
Start Free TrialLog in
Avatar of wlgarcia
wlgarcia

asked on

scalar multiplication of matrices in C

I need to create a program in C language that will calculate the multiplication of a matrix times a scalar value. All the user input should be read from a file. The input file must contain the size of matrix as well as the values stored inside the matrix and the scalar value by which the matrix will multiplied. The resulting matrix is to be stored in a new matrix called mResult and printed on the screen. Must have at least two functions aside from the main function. One hould handle the scalar*matrix multiplication and the other the output. Use any of the following loops; while, do-while, while.
Avatar of Infinity08
Infinity08
Flag of Belgium image

And what's your question ?
Simple.

Good luck!

<edited by sunnycoder>
ZAPE

Open in new window

Avatar of wktang83
wktang83

You have to create a class call Matrix.

To enable operation such as M * k (k is a scalar value, and M is a matrix), you need to overload the operator * in C. How much do you know about operator overloading?

If you are beginner to operator overloading, you may read this tutorial: http://www.learning-computer-programming.blogspot.com/2007/08/introduction-to-operator-overloading-in.html

Let me know your progress. Post questions if you are stucked, and we'll try to guide you along.

Regards,
wktang83
ASKER CERTIFIED SOLUTION
Avatar of jose_juan
jose_juan
Flag of Spain image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of wlgarcia

ASKER

I have some understanding about I/O. so the piece of advice you have given me is sufficient for me to build the program.