main()
{
int ptr[] = {1,2,23,6,5,6};
printf("%d",&ptr[3]-&ptr[0]);
}
Answer Posted / dipak
In int at least 2 bytes are used for size and we know that &ptr[] gives the address of ptr .
&ptr[3]-&ptr[0]
Size of &ptr[3] is 3*2=6 times greater than Size of &ptr[0] is 1*2=2
ptr[0] also have any value that's why I consider it 1
So 6-2=4
Is This Answer Correct ? | 4 Yes | 3 No |
Post New Answer View All Answers
can we have joblib in a proc ?
What is structure pointer in c?
Can you write a programmer for FACTORIAL using recursion?
how to make a scientific calculater ?
Read the following data in two different files File A: aaaaaaaadddddddd bbbbbbbbeeeeeeee ccccccccffffffff File B: 11111111 22222222 33333333 By using the above files print the following output or write it in the Other file as follows aaaaaaaa11111111dddddddd bbbbbbbb22222222eeeeeeee cccccccc33333333ffffffffffff
What is #include conio h?
Explain what does it mean when a pointer is used in an if statement?
Is there any possibility to create customized header file with c programming language?
How many types of operator or there in c?
Can a pointer be volatile in c?
In C language what is a 'dangling pointer'?
How can you find the day of the week given the date?
main() { struct s1 { char *str; struct s1 *ptr; }; static struct s1 arr[] = { {"Hyderabad",arr+1}, {"Bangalore",arr+2}, {"Delhi",arr} }; struct s1 *p[3]; int i; < BR> for(i=0;i<=2;i++) p[i] = arr[i].ptr; printf("%s ",(*p)->str); printf("%s ",(++*p)->str); printf("%s ",((*p)++)->str); }
How do you determine whether to use a stream function or a low-level function?
What is pointers in c with example?