Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



Challenge with Arrays 3d 4d

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 20-08-2010
Member
 
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.

Reply With Quote
  #2  
Old 20-08-2010
Member
 
Join Date: Dec 2007
Posts: 1,728
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
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Challenge with Arrays 3d 4d"
Thread Thread Starter Forum Replies Last Post
Arrays in C++ Acolapissa Software Development 3 19-12-2010 10:05 AM
Arrays in C# kavisg1 Software Development 3 07-10-2010 07:55 PM
Merging of arrays afidelino Software Development 5 02-03-2010 09:16 PM
How to use an Arrays in PHP? Jacques25 Software Development 4 25-02-2010 01:24 AM
Arrays in C# DotNetUser Guides & Tutorials 2 03-12-2008 05:31 PM


All times are GMT +5.5. The time now is 05:43 PM.