cleari_c |
Table of contents
Procedurecleari_c ( Clear an integer array ) void cleari_c ( SpiceInt ndim, SpiceInt array [] ) AbstractFill an integer array with zeros. Required_ReadingNone. KeywordsARRAY ASSIGNMENT Brief_I/OVARIABLE I/O DESCRIPTION -------- --- -------------------------------------------------- ndim I The number of elements of `array' which are to be set to zero. array O Integer array to be filled. Detailed_Inputndim is the number of elements in `array' which are to be set to zero. Detailed_Outputarray is the integer array which is to be filled with zeros. 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 and clear it afterwards. Example code begins here. /. Program cleari_ex1 ./ #include <stdio.h> #include "SpiceUsr.h" int main( ) { /. Local parameters. ./ #define NDIM 4 /. Local variables. ./ SpiceInt array [NDIM]; /. Initialize all member of the array `array' to 11, and print out its contents. ./ filli_c ( 11, NDIM, array ); printf( "Contents of ARRAY before cleari_c:\n" ); printf( "%4d %3d %3d %3d\n", (int)array[0], (int)array[1], (int)array[2], (int)array[3] ); /. Clear the contents of `array' and print it. ./ cleari_c ( NDIM, array ); printf( "\n" ); printf( "Contents of ARRAY after cleari_c:\n" ); printf( "%4d %3d %3d %3d\n", (int)array[0], (int)array[1], (int)array[2], (int)array[3] ); return ( 0 ); } When this program was executed on a Mac/Intel/cc/64-bit platform, the output was: Contents of ARRAY before cleari_c: 11 11 11 11 Contents of ARRAY after cleari_c: 0 0 0 0 RestrictionsNone. Literature_ReferencesNone. Author_and_InstitutionJ. Diaz del Rio (ODC Space) Version-CSPICE Version 1.0.0, 19-MAY-2021 (JDR) Index_Entriesclear an integer array |
Fri Dec 31 18:41:03 2021