#include<stdio.h>
int main(){
int a[]={1,2,3,5,1};
int *ptr=a+4;
int y=ptr-a;
printf("%d",y);
}
Answers were Sorted based on User's Feedback
Answer / 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 |
who developed c and why he developed c?
Why do we need volatile in c?
Write a C program to accept a matrix of any size. Find the frequency count of each element in the matrix and positions in which they appear in the matrix
Hi can anyone tell what is a start up code?
is it possible to change the default calling convention in c ?
the operator for exponencation is a.** b.^ c.% d.not available
What is your favorite subject?
1 Answers Ericsson, Invendis, Tech Mahindra,
how to find out the reverse number of a digit if it is input through the keyboard?
What is wrong with this statement? Myname = 'robin';
What is difference between && and & in c?
what would be the output of the following prog? Justify your answer? main() { unsigned char ch; unsigned char i; ch = -255; printf("%d",ch); i = -1; printf("%d",i); }
how to multiply two number taking input as a string (considering sum and carry )