#include<stdio.h>
int main(){
int a[]={1,2,3,5,1};
int *ptr=a+4;
int y=ptr-a;
printf("%d",y);
}

Answer Posted / harsha

as per my knowledge..4
a is base address of array
every array is a pointer
difference between the pointers is count of data elements ,but not difference between address
y=a+4-a
i.e., y=4

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are bitwise shift operators in c programming?

617


Which is the memory area not included in C program? give the reason

1481


Why do we use & in c?

564


How do you initialize pointer variables?

578


What are the advantages of c preprocessor?

672






What is c method?

508


write a program to find the given number is prime or not

3786


What is "Duff's Device"?

681


What are the advantages of the functions?

586


What would be an example of a structure analogous to structure c?

555


how could explain about job profile

1431


Which are low level languages?

609


What is a far pointer in c?

570


what is bit rate & baud rate? plz give wave forms

1491


What does a derived class inherit from a base class a) Only the Public members of the base class b) Only the Protected members of the base class c) Both the Public and the Protected members of the base class d) .c file

638