alibFlip
Reverses the elements in an array. The PV-WAVE API to this routine is the
REVERSE Function.
Prototypes
void alibFlipb( wvlong n, UCHAR *p, UCHAR *q )
void alibFlips( wvlong n, short *p, short *q )
void alibFlipi( wvlong n, int *p, int *q )
void alibFlipl( wvlong n, wvlong *p, wvlong *q )
void alibFlipf( wvlong n, float *p, float *q )
void alibFlipd( wvlong n, double *p, double *q )
void alibFlipc( wvlong n, COMPLEX *p, COMPLEX *q )
void alibFlipz( wvlong n, DCOMPLEX *p, DCOMPLEX *q )
Parameters
n — (Input) The number of elements in the source array.
*p — (Input) The source array.
*q — (Input/Output) The destination array. On return, array q contains the same elements as array p but in the opposite order.
Example
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "alib.h"
void main() {
wvlong n = 9;
UCHAR b0[9] = {0,1,2,3,4,5,6,7,8};
UCHAR *b;
b = (UCHAR*)malloc(n*sizeof(UCHAR));
alibinit( NULL, NULL, NULL, NULL );
alibFlipb( n, b0, b );
alibPrintArrayb( 1, 1, 1, n, b, NULL );
}
Output:
8 7 6 5 4 3 2 1 0
Version 2017.0
Copyright © 2017, Rogue Wave Software, Inc. All Rights Reserved.