what is alternative of pointer or address operator in vex?

   2238   2   1
User Avatar
Member
13 posts
Joined: May 2017
Offline
Hello!

now I'm coding using vex in houdini.

I'd like to make function like “swap” and “quck sort”.

like this in C++ :

void swap(int* a, int* b)
{
int tmp=*a;
*a=*b;
*b=tmp;
}

But I konw there is no pointer operator in vex.
so how can I access *a or &a?
User Avatar
Member
2048 posts
Joined: Sept. 2015
Offline
void swap(int a,b)
{
int temp_a;

temp_a = a;
a = b;
b = temp_a;

}
User Avatar
Member
13 posts
Joined: May 2017
Offline
Oh… Sorry.. It works.

I thought parameters would be copied.
but it is not.

Thank you again BabaJ
  • Quick Links