Thread: 4D arrays... under what situations would you use them, if at all?

  1. #1
    Registered User toaster's Avatar
    Join Date
    Apr 2002
    Posts
    161

    4D arrays... under what situations would you use them, if at all?

    read subject heading.

  2. #2
    Who knows. Could be plenty of reasons. What if you had an array representing a 3D space where each element was to contain a string description of the element?

    char 3DSpace[10][10][10][50];

    Just the first simple idea that popped to mind. ... Why?
    "There's always another way"
    -lightatdawn (lightatdawn.cprogramming.com)

  3. #3
    Fingerstyle Guitarist taylorguitarman's Avatar
    Join Date
    Aug 2001
    Posts
    564
    Database application is another one.
    If a tree falls in the forest, and no one is around to see it, do the other trees make fun of it?

  4. #4
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,490
    3d space plus time

  5. #5
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    I've seen them used several times just for the sake of simple storage. I don't think there's a reason for them to be obscure.

  6. #6
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,227
    If you get a school assignment to use 4D arrays?

  7. #7
    flashing vampire black's Avatar
    Join Date
    May 2002
    Posts
    563

    Wink Re: 4D arrays... under what situations would you use them, if at all?

    Originally posted by toaster
    read subject heading.
    4d array is not hard to build up but the concept is hard to understand.
    Never end on learning~

  8. #8
    Registered User Dual-Catfish's Avatar
    Join Date
    Sep 2001
    Posts
    802
    concept is hard to understand.
    int g_4DArray[5][5][5][5];
    Nah, just visualize a 5*5*5 3D Cube, and each element cooresponds to a 1D array of 5 elements.

  9. #9
    And what about 9D? (See Imagination thread.)
    "There's always another way"
    -lightatdawn (lightatdawn.cprogramming.com)

  10. #10
    Its not rocket science vasanth's Avatar
    Join Date
    Jan 2002
    Posts
    1,683
    Is there a way to build an array of arrays.. Line

    inr arrat[int array1[][][]]

    does it work.....

  11. #11
    I believe what you'd be looking for is an array of structs such as:

    struct
    {
    int SomeInts[10][10][10];
    } MyStructArray[10][20];

    Though in this situation I dont know why you would just use:

    int SomeInts[10][20][10][10][10];
    "There's always another way"
    -lightatdawn (lightatdawn.cprogramming.com)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. dynamically allocating 4D arrays
    By Marv in forum C Programming
    Replies: 15
    Last Post: 04-12-2007, 12:34 AM
  2. Need Help With 3 Parallel Arrays Selction Sort
    By slickwilly440 in forum C++ Programming
    Replies: 4
    Last Post: 11-19-2005, 10:47 PM
  3. The deal with using 4d arrays :D
    By Shamino in forum C++ Programming
    Replies: 9
    Last Post: 11-05-2005, 02:28 AM
  4. Crazy memory problem with arrays
    By fusikon in forum C++ Programming
    Replies: 9
    Last Post: 01-15-2003, 09:24 PM
  5. 3D or 4D arrays
    By Unregistered in forum C Programming
    Replies: 3
    Last Post: 02-25-2002, 06:02 PM