30 lines
452 B
C
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;
|
|
}
|