int main() { int arr[]={2,3,5,6,8}; int *ptr; ptr=&arr[3]; cout<<ptr-arr; }
Q.why the answer is 3 after compiling the code i.e. as it should be 3*sizeof(int) which in this case should be 3*4=12?
Aucun commentaire:
Enregistrer un commentaire