i was wandering if there is a way to pass an array to a function that is used on its members( kind of like how you pass the "this" parameter to object).
instead of this:
void public foo(A[] arr){}
void main(){
arr[i].foo(arr);
}
this:
void public foo(A[] arr){}
void main(){
arr[i].foo();
}
edit: arr is array of A, foo belongs to A sorry for bad explanation first question.
arr.foo()notarr[i].foo().foreach(A a in arr)foo(a);Or am I misunderstanding the question?void public foo(data_type var) { .... } void main() { foo(arr[i]) }