hello
i wonder if there is a way to return an array in function
like in java lang for example: int[] ret (int i,int j) {
int[] a = (i,j} ;
return a ;
}
or can i ewturn a pointer to a new array?
i need it for function i wrote
the function reduces duplicate values in array
void noDup[] ( int A[] , int n ) {
int i , j , k , s ;
k = n ;
for ( i=0 ; i<n ; i++ ) {
for ( j=0 ; j<n ; j++ )
if ( A[i] == A[j] ) {
for ( s=j ; s<n-1 ; s++ )
A[s] = A[s+1] ;
k-- ;
} // end if
} // end for
int tmp[k] ;
for ( i=0 ; i<k ; i++ )
tmp[i] = A[i] ;
A = tmp ;
} // noDup end
thank you