<div dir="ltr"><div><div><div><div><div><div><div><div><div><div><div><div><div>I was getting the same error, but what I was doing was this:<br></div>In the object structure I would write:<br></div>float x_iem_filter[5][2];<br>
<br></div>and in the new function I would write:<br></div>x->x_iem_filter[5][2] = {<br> {0.1, 0.2},<br></div> {0.3, 0.4}, etc.<br><br></div>different values though, this is an example. Then I would get the error:<br>
overDrive~.c:35:25: error: expected ';' at end of declaration list<br> float x_iem_coeff[5][2] = {<br><br></div>What I finally did was create a one dimensional array in the new structure like this:<br></div>
float iem_filter[10] = { ten values here };<br><br></div>and in the same function I run this:<br></div>for(i = 0; i < 5; i++){<br></div> for(j = 0; j < 2; j++)<br></div> x->x_iem_filter[i][j] = iem_filter[index++];<br>
}<br><br></div>which seems to work<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Jul 27, 2014 at 9:46 PM, Jonathan Wilkes via Pd-list <span dir="ltr"><<a href="mailto:pd-list@lists.iem.at" target="_blank">pd-list@lists.iem.at</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"><div><div class="h5">
<div>On 07/27/2014 01:05 PM, Alexandros
Drymonitis wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div>
<div>I solved it by declaring the array in the object
structure like this:<br>
</div>
float x_iem_coeff[5][2];<br>
<br>
</div>
and in the new function I create another, one dimensional array,
and run a nested for loop and set the local array's elements to
x_iem_coeff[5][2] one by one. This seemed to work, no errors
during compilation. The object crashes Pd when the DSP is turned
on, but I guess (and think) it's something else that causes
that. The array declaration and initialization shouldn't have
anything to do with the DSP state, right?<br>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Sun, Jul 27, 2014 at 7:41 PM,
Alexandros Drymonitis <span dir="ltr"><<a href="mailto:adrcki@gmail.com" target="_blank">adrcki@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div>
<div>
<div>
<div>I'm building an external where I want to create
a two dimensional array. I'm following <a href="http://www.tutorialspoint.com/cprogramming/c_multi_dimensional_arrays.htm" target="_blank">this</a> example which works
well with the attached test code, but creates an
error when I try to compile my external.<br>
</div>
The external's code where the array is being
declared and initialized is this:<br>
float x_iem_coeff[5][2] = {<br>
{0.045535, 1.0277},<br>
{0.161621, 1.2569},<br>
{0.393858, 1.96655},<br>
{1.13986, 4.51667},<br>
{6.36341, 22.7468}<br>
};<br>
<br>
</div>
which is in the object structure. The error I get is:<br>
overDrive~.c:35:25: error: expected ';' at end of
declaration list<br>
float x_iem_coeff[5][2] = {<br>
^<br>
;<br>
<br>
</div>
I've tried to declare the array in the object structure
and initialize it in the new function, but I still got
the same error.<br>
</div>
Any tips?<br>
</div>
</blockquote>
</div>
</div>
</blockquote>
<br></div></div>
In C, you can't initialize inside a struct. But you should be able
to initialize outside of it. What's the error you get when you try
that?<br>
<br>
-Jonathan<br>
<br>
<blockquote type="cite">
<div class="gmail_extra">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote>
</div>
<br>
</div>
<br>
<fieldset></fieldset>
<br>
<pre>_______________________________________________
<a href="mailto:Pd-list@lists.iem.at" target="_blank">Pd-list@lists.iem.at</a> mailing list
UNSUBSCRIBE and account-management -> <a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/listinfo/pd-list</a>
</pre>
</blockquote>
<br>
</div>
<br>_______________________________________________<br>
<a href="mailto:Pd-list@lists.iem.at">Pd-list@lists.iem.at</a> mailing list<br>
UNSUBSCRIBE and account-management -> <a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br>
<br></blockquote></div><br></div>