We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
array parameter (Read 512 times)
array parameter
Sep 15th, 2007, 1:35pm
 
I have a method with an array parameter,

int sumArray(int[] ia) {... return sum;}

This works:
//
int v;
int[] a1={1,2};
v=sumArray(a1);
a1=new int[] {7,5,9,6};
v=sumArray(a1);
...

This doesn't work: ?? (too bad)
//
int v;
v=sumArray({1,2});
v=sumArray({7,5,9,6});
...

Re: array parameter
Reply #1 - Sep 15th, 2007, 2:41pm
 
try:

sumArray( new int[]{ 1,2,3,4, .. } );

F
Re: array parameter
Reply #2 - Sep 15th, 2007, 4:21pm
 
Wow, it actually worked!!  Thanks.
Page Index Toggle Pages: 1