#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
Write a program to print factorial of given number using recursion?
What is unary operator?
What is use of pointer?
How can I sort a linked list?
Can we compile a program without main() function?
What is the difference between malloc calloc and realloc in c?
Explain the difference between call by value and call by reference in c language?
Where register variables are stored in c?
What will the preprocessor do for a program?
in ‘C’ language for Matrix Multiplication fails” Introspect the causes for its failure and write down the possible reasons for its failure.
What is string function c?
Which node is more powerful and can handle local information processing or graphics processing?
Explain the difference between exit() and _exit() function?
Explain what is a const pointer?
What is preprocessor with example?