#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
How can I do peek and poke in c?
How can I open a file so that other programs can update it at the same time?
What are the application of void data type in c?
Explain what are preprocessor directives?
if the area was hit by a virus and so the decrease in the population because of death was x/3 and the migration from other places increased a population by 2x then annually it had so many ppl. find our the population in the starting.
What is the value of a[3] if integer a[] = {5,4,3,2,1}?
What is the size of enum in bytes?
Explain why C language is procedural?
why do some people write if(0 == x) instead of if(x == 0)?
What are the two forms of #include directive?
What is the incorrect operator form following list(== , <> , >= , <=) and what is the reason for the answer?
Explain do array subscripts always start with zero?
Explain high-order and low-order bytes.
Explain enumerated types.
Do you know the purpose of 'register' keyword?