03-09-2010 08:16 PM
03-09-2010 11:10 PM
What is a dynamic 1-D array? Are you talking about a 1-D array of the dynamic data type?
To add an element into a 1-D array, you need to use the Insert Into Array function.
03-09-2010 11:29 PM
Something like this?
I am pretty sure there is a simpler way of doing this...This is what came to my mind randomly
03-10-2010 12:40 AM
Let me redfine the problem.
I have an array which is being populated continuously by a bit stream (a sequence of complex numbers). I have to insert a complex number after every 4th element of this array. Is this clearer?
Thanks
03-10-2010 12:45 AM
03-10-2010 08:39 AM
Dhiraj wrote:Let me redfine the problem.
I have an array which is being populated continuously by a bit stream (a sequence of complex numbers). I have to insert a complex number after every 4th element of this array. Is this clearer?
Thanks
Show the code that you have now that shows how the array is being populated.
What you can do is maintain a shift register like Guru showed you. Every time a new element is added, increment the shift register. You can also use the Quotient remainder function to divide by 4 and always increment the remainder. Whenever the remainder is zero, then add your extra element.
Guru's code looks correct, but if you are adding just one element at a time (instead of acting on a whole array at once as he shows), then you just need to implement the inner part of his code into yours.
03-10-2010 08:48 AM