#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 is a pointer value and address in c?

815


Why is c called a structured programming language?

990


a program that can input number of records and can view it again the record

1687


What is a shell structure examples?

792


How can you increase the size of a dynamically allocated array?

898


What is data types?

806


What does it mean when a pointer is used in an if statement?

842


How old is c programming language?

773


What is a null pointer in c?

823


What is wild pointer in c with example?

772


Can you tell me how to check whether a linked list is circular?

1059


What are the advantages of using Unions?

839


What is stack in c?

827


What is a list in c?

789


difference between native and cross compilers

1865