Index of Functions: A B C D E F G H I J K L M N O P Q R S T U V W X
Index Page cleari_c
Table of contents
Procedure Abstract Required_Reading Keywords Brief_I/O Detailed_Input | Detailed_Output Parameters Exceptions Files Particulars Examples | Restrictions Literature_References Author_and_Institution Version Index_Entries
#### Procedure
       cleari_c ( Clear an integer array )

       void cleari_c ( SpiceInt            ndim,
                       SpiceInt            array  [] )
#### Abstract
       Fill an integer array with zeros.
#### Required_Reading
       None.
#### Keywords
       ARRAY
       ASSIGNMENT
#### Brief_I/O
       VARIABLE  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_Input
       ndim        is the number of elements in `array' which are to be
                   set to zero.
#### Detailed_Output
       array       is the integer array which is to be filled with
                   zeros.
#### Parameters
       None.
#### Exceptions
       Error free.

       1)  If ndim < 1, the array is not modified.
#### Files
       None.
#### Particulars
       None.
#### Examples
       The 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
#### Restrictions
       None.
#### Literature_References
       None.
#### Author_and_Institution
       J. Diaz del Rio     (ODC Space)
#### Version
       -CSPICE Version 1.0.0, 19-MAY-2021 (JDR)
#### Index_Entries
       clear an integer array
#### Link to routine cleari_c source file cleari_c.c

    Fri Dec 31 18:41:03 2021