Not clear whether you have problems in declaring a 2D container or in showing a 2D container's data on a GUI?
If it's already been a year since you started on C++ I'm sure you know that a XxY matrix can be represented by:
typedef vector<int> ROW_VEC ;
vector< ROW_VEC > matrix ;
int init_values[] = { 1,2,3,4,5,6,7,8,9 } ;
ROW_VEC oneRow( init_values, init_values + 8 ) ;
for( int i = 1; i<=9; i++ )
{
random_shuffle( oneRow.begin(), oneRow.end() ) ;
matrix.push_back( oneRow ) ;
}
for( i = 0; i<matrix.size(); i++ )
{
for( int j = 0; j<matrix[i].size(); j++ )
cout << matrix[i][j] << '\t' ;
cout << endl ;
}
For pure C graphics use graphics.h.
For VC++ graphics you can use MS Flexi Grid (I donno what's DevC++)
thekashyap
Practically a Posting Shark
811 posts since Feb 2007
Reputation Points: 254
Solved Threads: 75