Thank you for the response apmcd47. I was beginning to wonder if anyone would reply. However, I'm not trying to make a 3D array. Either that or I have my terminology wrong. What I'm trying to achieve is a 1D array that holds references to 2D arrays and be able to call them.
Sorry, my mistake. I saw the three sets of [] and didn't notice the () around two of the brackets.
Quote:
I believe I've already got them initialized with the code already mentioned:
Which was in this post that was mentioned to. Perhaps Corona688 provide me with a 3D array in that post, but I though (*side[][])[] was different than (*side[][][]), no?
If you know a better way to call lists of two-dimensional arrays I would be more than happy to learn this. However, I'm afraid you may have confused this post with a 3D array instead.
Yes, you are right, I had indeed mistaken it for a 3D array.
Quote:
Either way, thank you for the reply!
EDIT: Also curious why you would not recommend C for arrays of 3D or larger? I understand that C supports up to 10 dimensions of arrays, which is more than any other language I know. Perhaps you were making this recommendation due to easy of use? If so, I'm not sure that a higher level language would be good for the rest of my code, but if you have suggestions I would be open to hear which ones.
I had not known about the 10 dimensions of arrays. I certainly would not have met that limit as, as I have said, I would have emulated a multi-dimensional array much sooner. Part of my reasoning is the fact that C's handling of arrays, arrays of arrays, etc are so similar from the programmer's point of view, that it can be confusing and lead to the problems you are experiencing. I'm afraid I have no recommendations for you.
Looking at your compiler error, I'm, wondering if the line
should be
Andrew
Hi,
I am trying to assign an array as a value to one of the array element, I mean
I have an array @KS and array @kr.
I want array @KS to hold @kr as an element.
So I am doin this
$KS=@kr;
But the value stored is number of elements in the @kr array.
Can... (2 Replies)
Suppose there are two arrays of arrays:
@A = ( , , , );
@B = ( , , , , );
For each of $A, $A, $A..., I want to find the corresponding one in @B (match the letter, like $A eq $B), and print out both the second item, for example, $A and $B.
How can I do this in perl? grep + map? Hope I... (1 Reply)
PHP question...I posted this on the Web Development forum, but maybe this is a better place!
I have an SQL query that's pulled back user IDs as a set of columns. Rather than IDs, I want to use their names.
So I have an array of columns $col with values 1,7,3,12 etc and I've got an array $person... (3 Replies)
Hi All
I need to get <STDIN> from a user. the <STDIN> is a range of number delimited by "," (comma) and can be with range delimited by "-".
Example: 1,2,3,4-9,12,15,34-36,70
Now I need to get this from the user and go on each number and "Do something"... but when trying to do this as above... (2 Replies)
here is what i have...
i=1
while read line
do
if grep -i-q "create procedure"<<<$line
then
startline="$line"
endline="blahblah"
Get procedure name into a variable named procName
procName="procedure name is stored"
do some... (2 Replies)
hello,
i need a bit of help on how to do this effectively in bash without a lot of extra looping or massive switch/case
i have a long array of M elements and a short array of N elements, so M > N always. M is not a multiple of N.
for case 1, I want to stretch N to fit M
arrayHuge
H = (... (2 Replies)
I hate I'm asking for help again. Unfortunately it seems there just aren't any links I can find on making an array that holds a bunch of two dimensional arrays. Maybe my google-fu is lacking. Basically I have a header file like this:
#define MATRIX 10
int white_l1;
int white_l2;
int... (2 Replies)
Le sigh... Hopefully this will be the last time I have to ask for help on this topic. For a while now I've been working with a 1d array that holds 2d arrays. For reference you can view here. Now I'm just trying to loop through the elements with the following:
#include <stdio.h>
void... (3 Replies)
So I need to Write an array processing program using a Linux shell programming language to perform the following.
Load array X of 20 numbers from an input file X.
Load array Y of 20 numbers from an input file Y.
Compute array Z by multiply Xi * Yi then compute the square-root of this... (2 Replies)