Thread: vectors acting up?

  1. #1
    Registered User
    Join Date
    May 2003
    Posts
    14

    vectors acting up?

    I can't work this one out.. please help.

    I have a matrix (vector<vector>), and fill it with chars read from file.
    Code:
    //-- while still stuff to read
    for(int i=0; i<=width && y<=height; i++)
    {
    	v.put(y, i, templine[i]);
    	cout << v.at(y, i);
    }
    y++;
    cout << endl;
    Here it looks as it should, something like:

    ¤******¤
    ¤******¤
    ¤******¤

    Then I call this:
    Code:
    for(int i=0; i<height; i++)
    {
                    for(int j=0; j<width; j++)
    	             cout << v.at(i, j);
    	cout << endl;
    }
    And it looks like this:
    *****¤
    ¤******¤
    ¤******¤

    What am I missing here?!
    /hsv

  2. #2
    Registered User
    Join Date
    May 2003
    Posts
    14
    oh.. I guess I'm a bit too tired for this right now. But it actually helped posting the code here, as I could see the error right away.

    sorry, I'm going to take a break now.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Vectors
    By naseerhaider in forum C++ Programming
    Replies: 11
    Last Post: 05-09-2008, 08:21 AM
  2. How can i made vectors measuring program in DevC++
    By flame82 in forum C Programming
    Replies: 1
    Last Post: 05-07-2008, 02:05 PM
  3. How properly get data out of vectors of templates?
    By 6tr6tr in forum C++ Programming
    Replies: 4
    Last Post: 04-15-2008, 10:35 AM
  4. How to use Vector's in C++ !?!
    By IndioDoido in forum C++ Programming
    Replies: 3
    Last Post: 10-14-2007, 11:13 AM
  5. Points, vectors, matrices
    By subnet_rx in forum Game Programming
    Replies: 17
    Last Post: 01-11-2002, 02:29 PM