just use a vector of vectors.
typedef std::vector<YourObject> YourObjectVector;
typedef std::vector<YourObjectVector> YourMatrix;
That's probably what that matrix thing is doing anyway. Also this is not a visual issue so the other board is better for that.
I don't know this matrix class and I don't think it's part of the STL (I may be wrong). Do you want matrix functions as inverse, determinant, multiplication etc. There are many matrix classes around, even I have written one (non MFC).
Originally posted by LudaLuda I noticed my usage of #include<vector> requires me to use the namespace std, why ?
what is the difference between #include<vector.h> and #include<vector>
In C++, the Standard Template Library (STL) is all in the namespace std so that it doesn't conflict with other definitions. <vector> is the standard include file for STL's vector container. <vector.h> is a deprecated (old) include file that some compilers provide for compatibility with programs written before the C++ standard came out. Never use this in new programs you write.
Get this small utility to do basic syntax highlighting in vBulletin forums (like Codeguru) easily.
Supports C++ and VB out of the box, but can be configured for other languages.
Originally posted by LudaLuda
Does anyone know what header file needs to be included to use the matrix class?
Since 'matrix' is not a standard class of the STL...it depends on where you got this class...
Originally posted by LudaLuda
is this an STL class? is this included in VC++ 6 ?
No...
Originally posted by LudaLuda
its suppose to create a 2D int-array with 2 Rows and 3 Columns
You can use a 'vector' as well as shown in the following FAQ...
Originally posted by LudaLuda
I noticed my usage of #include<vector> requires me to use the namespace std, why ?
what is the difference between #include<vector.h> and #include<vector>
According to ISO C++ standard, the definition all the classes, objects and functions of the standard C++ library are defined within namespace 'std'.
Almost all compilers, even those complying with ISO standard, allow the use of the traditional header files (like iostream.h, stdlib.h, etc). Nevertheless, the ISO standard has completely redesigned these libraries taking advantage of the template feature and following the rule to declare all the functions and variables under the namespace 'std'.
The standard has specified new names for these "header" files, basically using the same name for C++ specific files, but without the ending '.h'. For example, 'iostream.h' becomes 'iostream'.
If you use the ISO C++ compliant include files you have to bear in mind that all the functions, classes and objects will be declared under the 'std' namespace.
Ciao, Andreas
"Software is like sex, it's better when it's free." - Linus Torvalds
Bookmarks