[chuck-users] Dynamic Arrays (George Locke)

Perry R Cook prc at CS.Princeton.EDU
Sun Feb 2 16:24:58 EST 2014


   5. how do you resize an object array? (George Locke)

Here's something that should be useful.
(from the .pdf ChucK Manual, under Dynamic Arrays,
there's more there about it)


[64, 65, 60, 59] @=> int notes[];

notes << 58; // notes is [64, 65, 60, 59, 58]
notes << 60; // notes is [64, 65, 60, 59, 58, 60]

notes.popBack(); // [64, 65, 60, 59, 58]

notes << 64 << 65 << 60; // [64, 65, 60, 59, 58, 64, 65, 60]



More information about the chuck-users mailing list