filli_c |
Table of contents
Procedurefilli_c ( Fill an integer array ) void filli_c ( SpiceInt value, SpiceInt ndim, SpiceInt array [] ) AbstractFill an integer array with a specified value. Required_ReadingNone. KeywordsARRAY ASSIGNMENT Brief_I/OVARIABLE I/O DESCRIPTION -------- --- -------------------------------------------------- value I Integer value to be placed in all the elements of `array'. ndim I The number of elements in `array'. array O Integer array which is to be filled. Detailed_Inputvalue is the value to be assigned to the array elements 0 through ndim - 1. ndim is the number of elements in the array. Detailed_Outputarray is an integer array whose elements are to be set to `value'. ParametersNone. ExceptionsError free. 1) If ndim < 1, the array is not modified. FilesNone. ParticularsNone. ExamplesThe numerical results shown for this example may differ across platforms. The results depend on the SPICE kernels used as input, the compiler and supporting libraries, and the machine specific arithmetic implementation. 1) Initialize all members of an integer array to the same value. Example code begins here. /. Program filli_ex1 ./ #include <stdio.h> #include "SpiceUsr.h" int main( ) { /. Local parameters. ./ #define NDIM 4 /. Local variables. ./ SpiceInt array [NDIM]; SpiceInt i; /. Initialize all members of the array `array' to 11, and print out its contents. ./ filli_c ( 11, NDIM, array ); printf( "Contents of ARRAY:\n" ); for ( i = 0; i < NDIM; i++ ) { printf( " Index: %1d; value: %2d\n", (int)i, (int)array[i] ); } return ( 0 ); } When this program was executed on a Mac/Intel/cc/64-bit platform, the output was: Contents of ARRAY: Index: 0; value: 11 Index: 1; value: 11 Index: 2; value: 11 Index: 3; value: 11 RestrictionsNone. Literature_ReferencesNone. Author_and_InstitutionJ. Diaz del Rio (ODC Space) Version-CSPICE Version 1.0.0, 19-FEB-2021 (JDR) Index_Entriesfill an integer array |
Fri Dec 31 18:41:06 2021