verifying array initialization : Array Char « Data Type « C / ANSI-C






verifying array initialization

  
#include <stdio.h>

#define iGLOBAL_ARRAY_SIZE 10
#define iSTATIC_ARRAY_SIZE 20

int iglobal_array[iGLOBAL_ARRAY_SIZE];          /*a global array*/

int main( ){
 static int istatic_array[iSTATIC_ARRAY_SIZE]; /*a static array*/
 printf("iglobal_array[0]: %d\n",iglobal_array[0]);
 printf("istatic_array[0]: %d\n",istatic_array[0]);

 return(0);
}
  
    
  








Related examples in the same category

1.Compute the total of a list of numbers
2.Tic-Tac-ToeTic-Tac-Toe
3.Output the address of char array
4.For loop a char array
5.A simple dictionaryA simple dictionary
6.For loop a char array using pointer
7.Char array: pointer and loop
8.Assign a value to an element inside a char array
9.Char array: assign value and loopChar array: assign value and loop
10.Loop and output a char array
11.how array addressing and pointer arithmetic are linkedhow array addressing and	pointer arithmetic are linked
12.Show how bitmapped graphics may be usedShow how bitmapped graphics may be used
13.the use of strings
14.contiguous array storage