vendredi 6 mars 2015

Pointer Conception


Here i get 4225440 as the address of arr[0]; as it an integer array, the address will be increased by 4, so next one will be 4225444;


now



  1. whats happen with those addresses

  2. if put manualy one of addresses it shows absurd value from where it comes.


This is the code under discussion



#include <stdio.h>

int arr[10],i,a,*j;
void del(int a);

main()
{
for(i=0;i<4;i++)
scanf("%d",&arr[i]);

j=(int*)4225443;

for(i=0;i<4;i++)
{
printf("\n%d ",arr[i]);
printf(" %d ",&arr[i]);
}

printf(" %d ",*j);
}



Aucun commentaire:

Enregistrer un commentaire