Results 1 to 2 of 2

Thread: Challenge with Arrays 3d 4d

  1. #1
    Join Date
    Aug 2010
    Posts
    1

    Challenge with Arrays 3d 4d

    Does anybody know of any programming challenges that may involve doing something with a 3d or 4d array. Prefereabbly in java.

    I spend my time writing docs these days and need a technical challenge.

  2. #2
    Join Date
    Dec 2007
    Posts
    1,736

    Re: Challenge with Arrays 3d 4d

    You can try to make a four-dimensional array and hopefully the below code will work for you:

    Code:
    TH009MA@th009ma-shl2-01 /cygdrive/d/temp
    $ cat junk.cpp
    #include <iostream>
    using namespace std;
    
    int main() {
    
    int nArray[2][2][2][2] = {
    
    { { {1, 2} , { 3, 4} } , { { 5, 6} , { 7, 8} } },
    
    { { {9,10} , {11,12} } , { {13,14} , {15,16} } }
    
    };
    
    cout << "nArray[0][0][0][0]: " << nArray[0][0][0][0] << endl;
    
    cout << "nArray[1][0][1][0]: " << nArray[1][0][1][0] << endl;
    
    cout << "nArray[1][1][0][1]: " << nArray[1][1][0][1] << endl;
    
    return 0;
    
    }
    
    
    TH009MA@th009ma-shl2-01 /cygdrive/d/temp
    $ g++ -o junk junk.cpp
    
    TH009MA@th009ma-shl2-01 /cygdrive/d/temp
    $ ./junk
    nArray[0][0][0][0]: 1
    nArray[1][0][1][0]: 11
    nArray[1][1][0][1]: 14

Similar Threads

  1. Arrays in C++
    By Acolapissa in forum Software Development
    Replies: 3
    Last Post: 19-12-2010, 10:05 AM
  2. Arrays in C#
    By kavisg1 in forum Software Development
    Replies: 3
    Last Post: 07-10-2010, 07:55 PM
  3. Merging of arrays
    By afidelino in forum Software Development
    Replies: 5
    Last Post: 02-03-2010, 09:16 PM
  4. How to use an Arrays in PHP?
    By Jacques25 in forum Software Development
    Replies: 4
    Last Post: 25-02-2010, 01:24 AM
  5. Arrays in C#
    By DotNetUser in forum Guides & Tutorials
    Replies: 2
    Last Post: 03-12-2008, 05:31 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,282,595.57835 seconds with 16 queries