Results 1 to 3 of 3

Thread: vector issues....

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2001
    Location
    I'm mobile
    Posts
    166

    vector issues....

    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

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    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
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Aug 2001
    Location
    I'm mobile
    Posts
    166
    ok, thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width