RWalib C Array Library User Guide > Array Initialization > alibCopy
  

alibCopy
Copies an array into another array. The PV-WAVE API for this routine is the Assignment Operator =.
Prototypes
void alibCopyb( wvlong n, UCHAR *p, UCHAR *q )
void alibCopys( wvlong n, short *p, short *q )
void alibCopyi( wvlong n, int *p, int *q )
void alibCopyl( wvlong n, wvlong *p, wvlong *q )
void alibCopyf( wvlong n, float *p, float *q )
void alibCopyd( wvlong n, double *p, double *q )
void alibCopyc( wvlong n, COMPLEX *p, COMPLEX *q )
void alibCopyz( wvlong n, DCOMPLEX *p, DCOMPLEX *q )
Parameters
n — (Input) The number of elements to copy.
*p — (Input) The source array.
*q — (Input/Output) The destination array. On return, array q is a copy of array p.
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 );
    alibCopyb( n, b0, b );
    alibPrintArrayb( 1, 1, 1, n, b, NULL );
}
 
Output:
 
   0   1   2   3   4   5   6   7   8

Version 2017.0
Copyright © 2017, Rogue Wave Software, Inc. All Rights Reserved.