[chuck-users] how best to resize array?

Julien Saint-Martin julien.saintmartin at googlemail.com
Fri Jul 27 10:31:48 EDT 2012


Hi George,

You can check examples in Chuck installation directory: \examples\array\
array_resize.ck and array_dynamic.ck
Personally I use:
array.size(new_size);
or
array << new_element; // to add an element.

Happy chucking,
Julien


2012/7/27 George Locke <george.locke.maxmsp at gmail.com>

> Hi,
>
> I am creating an array, but i don't know how big I need it to be at the
> time it is instantiated.  Once I figure out what I want that size to be,
> how do I assign it?  The current solution i have is this:
>
> int array[];
> int size;
> // do stuff
> { // new block keeps dummy from clogging namespace
> int dummy[size];
> dummy @=> array;
> }
>
> Is there a better way?
>
> Regards,
> George
>
> _______________________________________________
> chuck-users mailing list
> chuck-users at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20120727/2e6d57e0/attachment.html>


More information about the chuck-users mailing list