RWalib C Array Library User Guide > Type Conversion > alibLong
  

alibLong
Converts an array to type wvlong (64-bit int). The PV-WAVE API for this routine is the LONG Function.
Prototypes
void alibLongb( wvlong n, UCHAR *p, wvlong *r )
void alibLongs( wvlong n, short *p, wvlong *r )
void alibLongi( wvlong n, int *p, wvlong *r )
void alibLongl( wvlong n, wvlong *p, wvlong *r )
void alibLongf( wvlong n, float *p, wvlong *r )
void alibLongd( wvlong n, double *p, wvlong *r )
Parameters
n — (Input) The number of elements in the source array.
*p — (Input) The n-element source array.
*r — (Input/Output) The n-element destination array. On return, r is the array obtained from array p by converting each of its elements to type wvlong.
Example
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "alib.h"
void main() {
   UCHAR  b0[9] = {0,1,2,3,4,5,6,7,8};
   wvlong *b;
   b = (wvlong*)malloc(9*sizeof(wvlong));
   alibinit( NULL, NULL, NULL, NULL );
   alibPrintArrayb( 1, 1, 1, 9, b0, NULL );
   alibLongb( 9, b0, b );
   printf( "\n\n print the 9-element result as a (3,3) array" );
   alibPrintArrayl( 1, 1, 3, 3, b, NULL );
}
 
Output:
 
   0   1   2   3   4   5   6   7   8
 
 print the 9-element result as a (3,3) array
 
               0               1               2
               3               4               5
               6               7               8

Version 2017.1
Copyright © 2019, Rogue Wave Software, Inc. All Rights Reserved.