RWalib C Array Library User Guide > Type Conversion > alibInt
  

alibInt
Converts an array to type int. The PV-WAVE API for this routine is the INT32 Function.
Prototypes
void alibIntb( wvlong n, UCHAR *p, int *r )
void alibInts( wvlong n, short *p, int *r )
void alibInti( wvlong n, int *p, int *r )
void alibIntl( wvlong n, wvlong *p, int *r )
void alibIntf( wvlong n, float *p, int *r )
void alibIntd( wvlong n, double *p, int *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 int.
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};
   int *b;
   b = (int*)malloc(9*sizeof(int));
   alibinit( NULL, NULL, NULL, NULL );
   alibPrintArrayb( 1, 1, 1, 9, b0, NULL );
   alibIntb( 9, b0, b );
   printf( "\n\n print the 9-element result as a (3,3) array" );
   alibPrintArrayi( 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.