You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
423 B
C
23 lines
423 B
C
#include <stdio.h>
|
|
|
|
#define ARRLEN 10
|
|
|
|
int my_array[ARRLEN];
|
|
|
|
int main(void)
|
|
{
|
|
size_t i, j; // guaranteed to be wide enough to address all memory locations. Better than unsigned int.
|
|
|
|
for (i = 0; i < ARRLEN; i++)
|
|
{
|
|
my_array[i] = i + 100;
|
|
}
|
|
|
|
// Output each array element's values
|
|
for (j = 0; j < ARRLEN; j++)
|
|
{
|
|
printf("Element[%zu] = %d\n", j, my_array[j]);
|
|
}
|
|
|
|
return 0;
|
|
} |