Question regarding main-functions in Exercise 1

Disclaimer: Dieser Thread wurde aus dem alten Forum importiert. Daher werden eventuell nicht alle Formatierungen richtig angezeigt. Der ursprüngliche Thread beginnt im zweiten Post dieses Threads.

Question regarding main-functions in Exercise 1
Hi,

I encountered a small problem in the current exercise. As I put the MatrixTest.cpp, MatrixProduct.cpp and Matrix.h files all in one solution, I get an error since I have two main functions defined (one in MatrixTest and one in MatrixProduct). How should I handle this (obviously I can just comment out one of the main functions, but I am not sure if that is intended)?

Thanks for the help!


I figured they want you to place the whole matrix implementation (class definitions and header definitions and implementation) into [m]Matrix.h[/m]. [m]MatrixProduct.cpp[/m] then includes [m]Matrix.h[/m] and prodivdes a main function reading input from standard input and performing the operations. [m]MatrixTest.cpp[/m] is used for testing and should be compiled into a test binary. You are not supposed to link [m]MatrixTest.cpp[/m] and [m]MatrixProduct.cpp[/m] into one binary.


That makes sense, thanks for the help!