multi dimensional array definition

This is a discussion on multi dimensional array definition within the C Programming forums, part of the General Programming Boards category; How would I define this array to values i want to specify? index[4][4]={1, 0, 0, 0} {0, 1, 0, 0} ...

  1. #1
    Registered User gazsux's Avatar
    Join Date
    Mar 2002
    Posts
    72

    multi dimensional array definition

    How would I define this array to values i want to specify?

    index[4][4]={1, 0, 0, 0}
    {0, 1, 0, 0}
    {0, 0, 1, 0}
    {-tx, -ty, -tz, 1};

    I get errors when i try to do it this way.

  2. #2
    Registered User Sargnagel's Avatar
    Join Date
    Aug 2002
    Posts
    166
    Code:
    index[4][4]={ {1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, 1, 0}, {-tx, -ty, -tz, 1} };

  3. #3
    Registered User gazsux's Avatar
    Join Date
    Mar 2002
    Posts
    72
    ahhh, thanking you good man

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 16
    Last Post: 05-29-2009, 08:25 PM
  2. Zero out two dimensional array
    By davo666 in forum C Programming
    Replies: 16
    Last Post: 01-08-2009, 05:28 AM
  3. Multi dimensional array
    By $l4xklynx in forum C Programming
    Replies: 7
    Last Post: 01-03-2009, 03:56 AM
  4. Unknown Memory Leak in Init() Function
    By CodeHacker in forum Windows Programming
    Replies: 3
    Last Post: 07-09-2004, 10:54 AM
  5. 2d arrays in C
    By Unregistered in forum C Programming
    Replies: 6
    Last Post: 04-20-2002, 12:09 PM

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