CS2263/ForNextDay/Lec6/Lec6src/array1.c
2023-05-22 23:28:51 -03:00

30 lines
452 B
C

#include <stdio.h>
#include <stdlib.h>
#define N 5
int main()
{
int i;
int j;
int iErr;
int a[5];
printf("i: %p\n",&i);
printf("j: %p\n",&j);
printf("iErr: %p\n",&iErr);
printf("a: %p\n",a);
printf("enter some integers,followed by ^D on blank line: ");
i = 0;
iErr = 1;
while( iErr != 0 && i < N ){
iErr = scanf("%d",&a[i]);
i++;
}
for(j = 0; j < i+2; j++)
printf("a[%d]: %d @ %p\n", j, a[j], &a[j]);
return EXIT_SUCCESS;
}