#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
what are non standard function in c
What is switch in c?
What is scanf () in c?
What is abstract data structure in c?
Explain the properties of union. What is the size of a union variable
What is an array? What the different types of arrays in c?
How would you rename a function in C?
Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?
how much salary u want ? why u join in our company? your domain is core sector why u prefer software ?
What is structure data type in c?
If fflush wont work, what can I use to flush input?
What is nested structure?
What are the two types of functions in c?
The number of bytes of storage occupied by short, int and long are a) 2, 2 and 4 b) 2, 4 and 4 c) 4, 4 and 4 d) none
Do pointers store the address of value or the actual value of a variable?