#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 |
I heard that you have to include stdio.h before calling printf. Why?
#include<stdio.h> int fun(); int i; int main() { while(i) { fun(); main(); } printf("hello \n"); return 0; } int fun() { printf("hi"); } answer is hello.how??wat is tat while(i) mean?
Why c++ is called c++ and not c+?
write a program to insert an element at the specified position in the given array in c language
what will be the output of this program? #include<stdio.h> #define cube(x) x*x*x void main() { int i,j=5; i=cube(j+3); printf("i=%d",i); }
proc() { static i=10; printf("%d",i); } If this proc() is called second time, what is the output?
whitch value return void main?
Is there any data type in c with variable size?
WHAT IS ABSTRACT DATA TYPE
Why do we use static in c?
What is data structure in c and its types?
What are shell structures used for?