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
pointers. (Read 1082 times)
pointers.
Jul 26th, 2008, 11:31am
 
Not really a syntax question per-se, but is it possible to use pointers in processing?
Re: pointers.
Reply #1 - Jul 26th, 2008, 1:02pm
 
processing being based on java does not have pointers. but objects are passed by reference and that's pretty close to pointers from my perspective ...

F
Re: pointers.
Reply #2 - Jul 26th, 2008, 4:44pm
 
Like fjen says, all objects are actually references anyway.

So when you declare

MyClass myInstance;

myInstance is actually a pointer to MyClass - hence the need to do myInstance = new MyClass(...) before using it.

If you need a pointer to int, char etc you can use the syntax

int []myInts;
You dont get the same low-level memory control as you would in C, but you can pass it to functions etc...

This is all standard Java stuff and not specific to Processing.
Page Index Toggle Pages: 1