#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 |
Is fortran still used today?
What is the argument of a function in c?
the real constant in c can be expressed in which of the following forms a) fractional form only b) exponential form only c) ascii form only d) both a and b
write a program to swap bits in a character and return the value prototype of function char fun (char a, charb flag c) where fun returns a char, char a is a the value char b is the bit to be changed and flag c is the bit value for eg: x=fun(45,7,0) since 45 is 0010 0101 and ow x should contain the value 65 (0110 0101)
1 Answers Bosch, College School Exams Tests,
which is faster execution: loops or recursion?
Can you return null in c?
How many levels of indirection in pointers can you have in a single declaration?
0 Answers Agilent, ZS Associates,
Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor
Does c have class?
What is maximum size of array in c?
what is link list?
What are c header files?