Hello my friends
I wrote a code to build a matrix class. my code is in the united type and being run as well. I want to separate it into main.cpp , matrix.h and matrix.cpp ones. when I try to do that give me the error "the vector does not name a type"
please someone can do it for me
the best
Mohsen
HINT: you can edit your post and add the code tags.
Which member function are you trying to put into a .cpp file? And what is the error you are getting? Simply saying you are getting an error doesn't help us to help you.
#ifndef matrix_h
#define matrix_h
#include <vector> // this is the only thing we depend on in this header
class matrix
{
private:
std::vector<std::vector<double> > my_matrix;
public:
matrix(unsigned ,unsigned, double);
void print() const;
};
#endif
That is a linker error. Linker should combine object codes to an executable, but it was not given all objects. Both main.cpp and matrix.cpp has to be in the build.