Thread: Help!! Initializing a matrix

  1. #1
    Registered User
    Join Date
    Nov 2004
    Posts
    3

    Help!! Initializing a matrix

    I have a new program due, but I have no idea how to do it, maybe you guys will help me to get started with it. here's the problem:

    - Initialize a 3x3 matrix
    - Using nested loops, initialize the matrix to hold values as follows:

    1 2 3
    4 5 6
    7 8 9

    - Output the matrix in an easily readable format

    I'm not really good at c++, but maybe you guys could help me.
    Thanks in advance.

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    What have you tried so far?
    My best code is written with the delete key.

  3. #3
    Registered User
    Join Date
    Nov 2004
    Posts
    3
    I know the basics, how to start and how to end it, but I don't know the code that I need for the nested loops.

  4. #4
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    Okay. What have you tried so far?
    My best code is written with the delete key.

  5. #5
    Toaster Zach L.'s Avatar
    Join Date
    Aug 2001
    Posts
    2,686
    Post code. Let us see what you've tried. Look at the programming tutorials on this website.

    *edit*
    Nice motto Prelude. I'd not noticed that before.
    Last edited by Zach L.; 11-21-2004 at 08:58 AM.
    The word rap as it applies to music is the result of a peculiar phonological rule which has stripped the word of its initial voiceless velar stop.

  6. #6
    Registered User
    Join Date
    Nov 2004
    Posts
    3
    I don't have anything, that's why I need help.

  7. #7
    Toaster Zach L.'s Avatar
    Join Date
    Aug 2001
    Posts
    2,686
    Then I suggest the first three (at least) tutorials here:
    http://www.cprogramming.com/tutorial.html

    The one titled Arrays might even be of use.
    The word rap as it applies to music is the result of a peculiar phonological rule which has stripped the word of its initial voiceless velar stop.

  8. #8
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    There are about ten millions posts on the game programming forum relating to matrices do's and don'ts. Perhaps a board search is in order.

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, 05:57 PM
  3. 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
  4. Matrix Reloaded Questions (SPOILERS_
    By Xei in forum A Brief History of Cprogramming.com
    Replies: 73
    Last Post: 10-19-2003, 02:21 PM