I would like pointer for passing arguments in function by reference and menage array in a easier way
Which are the essential scripts nowadays?
Started by
CastChaos
, Aug 05 2017 09:04 AM
17 replies to this topic
#16
Posted 03 October 2017 - 01:34 AM
#17
Posted 03 October 2017 - 04:57 AM
I would like pointer for passing arguments in function by reference and menage array in a easier way
Better arrayy stuff is in the works.
IDK what you want to do with pointers, but this is already legal:
int arr[20]; ffc script a{ void run(){ int x =getffX(this); //pass the pointer for this ffc to the function. setIndex(arr, 2, x): //uses the pointyer to array *arr this->Y = getIndex(arr, 2+x);// also uses the pointer of *arr } int getIndex(int ptr, int inx){ return ptr[inx]; void setIndex(int ptr, int inx, int v){ ptr[inx] = v;} int getffX(ffc f){ return f->X;) }
#18
Posted 03 October 2017 - 08:07 AM
Better arrayy stuff is in the works.
IDK what you want to do with pointers, but this is already legal:int arr[20]; ffc script a{ void run(){ int x =getffX(this); //pass the pointer for this ffc to the function. setIndex(arr, 2, x): //uses the pointyer to array *arr this->Y = getIndex(arr, 2+x);// also uses the pointer of *arr } int getIndex(int ptr, int inx){ return ptr[inx]; void setIndex(int ptr, int inx, int v){ ptr[inx] = v;} int getffX(ffc f){ return f->X;) }
Oh thanks i completely did nit know you can do that. So basically int p can either p an integer or an array.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users