Jump to content

Framing an array in a loop


supriyav

Recommended Posts

I've an input array A[255]

such that A[0] to A[3] is considered as a block

Therfore totally 64 blocks (from Block 0 to Block 63)

I'll get a command with Start block and number of blocks to read.

Start Block= 0 to 63

Numblocks=1 to n n depends on the Start block

i.e if Start Block=0 then the NumBlocks=1 to 64

if Start block=1 then NumBlocks=1 to 63 ...

i need to frame an output array for all the combination.

to make it simple i want to use loop.But i cudn't make it up.

Pls do the needful

Thanks and Regards

Supriya

Link to comment

I can probably help but I need more information

I've an input array A[255]

such that A[0] to A[3] is considered as a block

Therfore totally 64 blocks (from Block 0 to Block 63)

How does this equate to 255 is it a 4x64 2D array or a 1x255 1D array

I'm confused as to what exactly a block is. Is it an element in the array or a group of elements.

I'll get a command with Start block and number of blocks to read.

Start Block= 0 to 63

Numblocks=1 to n n depends on the Start block

i.e if Start Block=0 then the NumBlocks=1 to 64

if Start block=1 then NumBlocks=1 to 63 ...

so 2=1 to 62

and 63=1

n(NumBlocks)=1 to 64-(Start block)?

i need to frame an output array for all the combination.

what do you mean by frame? 1D array 2D array

to make it simple i want to use loop.But i cudn't make it up.

Pls do the needful

Thanks and Regards

Supriya

It would help if you could post the code you are working on. If I can see what you are using for input and outputs it is much easier.

Also remember to save it as a development distribution llb before posting.

Link to comment
Your definition of a block as related to the array information does not jive. In any case, regardless, what you probably want is to use the array subset function. You can feed in the start index and length of the the elements you want. This should handle what you want.

Array[255] is a single dim array.

each four element is a Block.

A[0] to A[3] --- Block0

A[4] to A[7] --- Block1

...

Thanks for ur Reply... I did it Using the Array Subset functionality...

I need one more help...

Can You pls tell me

How to calculate Checksum for an array using Compound Artithmetic (Xor) Without Splitting the array

Actually My output array varies i.e it may be 5,10,15,20,...255 depending upon the Command (Start block and NumBlock)

Splitting this big array occupies space...

Can you Suggest me some easy way

Pls Do the needful

Thanks and regards

SupriyaV

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.