# How arrays work

**URL:** <https://www.ruby-forum.com/t/how-arrays-work/238244>\
**Category:** GNU Radio\
**Created:** [December 27, 2013, 10:35am UTC](https://www.ruby-forum.com/t/how-arrays-work/238244 "2013-12-27T10:35:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Detlef\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/58f4c7/32.png) [@Detlef\_R](https://www.ruby-forum.com/u/Detlef_R)\
**Post date:** [December 27, 2013, 10:35am UTC](https://www.ruby-forum.com/t/how-arrays-work/238244/1 "2013-12-27T10:35:05Z")

</div>

I wrote this array under the  
interp\_ff\_impl::work(int noutput\_items,  
gr\_vector\_const\_void\_star &input\_items,  
gr\_vector\_void\_star &output\_items)

int f[m];  
I could not initialise by  
int f[m]={0};  
block is also not work can we write array like the above in gnuradio c++  
code

---

<div class="post-metadata">

**Author:** ![MHMND\_Herath](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ecccb3/32.png) [@MHMND\_Herath](https://www.ruby-forum.com/u/MHMND_Herath)\
**Post date:** [December 30, 2013, 3:51pm UTC](https://www.ruby-forum.com/t/how-arrays-work/238244/2 "2013-12-30T15:51:13Z")

</div>

On Fri, Dec 27, 2013 at 4:43 AM, MHMND Herath [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ```
> I wrote this array under the
> 
> ```
> 
> interp\_ff\_impl::work(int noutput\_items,  
> gr\_vector\_const\_void\_star &input\_items,  
> gr\_vector\_void\_star &output\_items)
> 
> int f[m];  
> I could not initialise by  
> int f[m]={0};  
> block is also not work can we write array like the above in gnuradio c++ code

This is really a C++ question and not a GNU Radio question. But,  
anyways, without more information about ‘m’, I would say no, generally  
this is not acceptable C++ code since you’re trying to create an array  
with a variable as the size of the array.

But look to the C++ forums and reask the question there if you cannot  
find it.

Tom
