matrix

This is a discussion on matrix within the C++ Programming forums, part of the General Programming Boards category; Can anyone help me in trying to figure out how to create and display a matrix using vectors? Totally confused ...

  1. #1
    Registered User
    Join Date
    Sep 2001
    Posts
    4

    Question matrix

    Can anyone help me in trying to figure out how to create and display a matrix using vectors? Totally confused on this subject.

  2. #2
    Anti-Terrorist
    Join Date
    Aug 2001
    Location
    mming, Game DevelopmentCSR >&<>&2Minimization of boolean functions, PROM,PLA design >&0>&WA, USA guitar, dogsCommercial Aviation >&>>&USAProgramming
    Posts
    742
    I don't mean to mess up this thread. I'm rather new to C++. In standard C you could use a two dimentional array to represent a matrix, such as:
    Code:
    char matrix[10[10];
    However the C++ vector is a container, as in:
    vector<type> allocator

    I can see how someone could use the string class like this:
    vector<string> v_string;

    Or maybe you could do something like this:
    Code:
    typedef struct
    {
      char matrix[10][10]
    }matrix_t;
    
    vector<matrix_t> v_matrix;
    But than this would be a vector of matricies. Not quite what you want. I would like to know the answer to this question too!
    I compile code with:
    Visual Studio.NET beta2

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C - access violation
    By uber in forum C Programming
    Replies: 2
    Last Post: 07-08-2009, 01:30 PM
  2. Matrix Help
    By HelpmeMark in forum C++ Programming
    Replies: 27
    Last Post: 03-06-2008, 04:57 PM
  3. Gauss-Jordan Matrix Inversion in C++
    By Max_Power82 in forum C++ Programming
    Replies: 3
    Last Post: 12-03-2006, 07:31 PM
  4. Matrix and vector operations on computers
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 11
    Last Post: 05-11-2004, 06:36 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21