|
-
Jul 22nd, 2004, 09:59 AM
#1
Thread Starter
Addicted Member
Copy Part of an Array [Resolved]
How would I copy part of a four dimmensional array to a one d array. I only want part of it. For example in vb I would say
Code:
for i = 1 to 25
my1darray(i) = my4darray(i,12,12,12)
next i
The array will not always be 25 though. It has to be flexible. Thanks.
Last edited by jordan23; Jul 22nd, 2004 at 05:16 PM.
-
Jul 22nd, 2004, 04:40 PM
#2
Sleep mode
Umm , so how many elements do you want to copy and from which dimension number you want to start copying ??
-
Jul 22nd, 2004, 04:42 PM
#3
Thread Starter
Addicted Member
Well, the number of elements will vary but lets say 25. It will go with the first index. So it would be myArray(1-25,11,11,4) like that. Does that make sense?
-
Jul 22nd, 2004, 05:14 PM
#4
Sleep mode
This will add the values from the first element of the first dimension of my4darray to my1darray .
PHP Code:
for(int i=0 ;i<= my1darray.GetUpperBound(0);i++)
{
my1darray[i] = my4darray(i,12,12,12);
}
I didn't test the code (hope no errors... )but i assumed arrays declaration were done right .
-
Jul 22nd, 2004, 05:16 PM
#5
Thread Starter
Addicted Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|