PDA

Click to See Complete Forum and Search --> : vector issues....


[praetorian]
Aug 23rd, 2001, 03:47 PM
hello!

Anybody knows exactly why a 2-dimensional vector have to be used as a pointer to that one when you declare it and later on, you just can use it like a normal vector......any ideas?

example:

char *months[3][12] =
{
{bla............blah..........},
{bla............blah..........},
{bla............blah..........},
};
.
.
.
cout << months[3][1];

/praetorian

kedaman
Aug 23rd, 2001, 04:09 PM
2 dimensional vectors are called matrices
the array data is not stored with the dimension so it could be interpreted in much any way, the compiler is only keeping track of the array dimensions for you to use it as a matrix, otherways as it is stored consequentially the char array is written until next null, no matter what dimensions you have

[praetorian]
Aug 23rd, 2001, 05:03 PM
ok, thanks!