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


Please Help Members By Posting Answers For Below Questions

can we have joblib in a proc ?

1650


What is structure pointer in c?

565


Can you write a programmer for FACTORIAL using recursion?

608


how to make a scientific calculater ?

1562


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

2238






What is #include conio h?

589


Explain what does it mean when a pointer is used in an if statement?

613


Is there any possibility to create customized header file with c programming language?

619


How many types of operator or there in c?

599


Can a pointer be volatile in c?

531


In C language what is a 'dangling pointer'?

632


How can you find the day of the week given the date?

611


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); }

910


How do you determine whether to use a stream function or a low-level function?

645


What is pointers in c with example?

575