main()
{
int arr[]={12,14,16,18,20}
printf("%u%u";arr+1,&arr+1);
}
//tell me the answer of this question with proper reason..:)//
Answer Posted / rpr
The correct question should be:
main()
{
int arr[]={12,14,16,18,20};
printf("%u%u",arr+1,&arr+1);
}
there are two different notations:
arr+1 and &arr+1;
arr is same as &arr[0] - location of arr[0], first element
arr+1 is same as &arr[1] - location of arr[1]
arr+2 is same as &arr[2] - location of arr[2]
and so on...
here if address of arr is 6524 then address of arr+1 is
6526, address of arr+2 is 6528.. as arr is of int type so a
difference of two.
now about &arr
it represents the location of entire array.
so it will gives address of first element of array.
when 1 is added to it, the size of array is added to it..
example..
if the address of first element,arr[0] is 6524
and the size of array is-
-(no. of elements)*(size of each element)
here 5*2=10
then,
&arr = 6524
&arr+1 = 6524+(1*size of array)=6524+(1*10)=6534
&arr+2 = 6524+(2*10)=6544
and so on..
one more point:
as here notations are behaving in a pointer manner(actually
reference).. you should know pointer saves values in
unsigned int- from 0-65535
..
once the value of pointer reaches 65535, it comes back to 0.
-rpr..ravidasonline@gmail.com
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
what is advantages and disadvantages of CAT5,CAT5e,CAT6,CAT7,COAXIAL CABLE,FIBER-OPTIC
Explain the memory reference and register reference instructions as micor operation.
what are the areas of improvement required in yourself to achieve your career goals? Describe what you are doing/plan to do to address the areas of improvement
Difference between software process model and software process.?
how can i install windows-xp operating system in single time to 50 computersconnected in a LAN.
Problem:Design and implement a class that allows a teacher to track the grades in a single ourse.Include methods that calculate the average grae, the highest grade, and the lowest grade.Wrute a program to testyour class implementation in a c#. given grades:integral=85, physics=87, datastruct=84.
when load increase in generator in island mode, why turbine rpm is reduced
plz tell me which books r important for gate exam (CSE)
My system suddenly get off,when i try to power on then it does not work but when i open it and clean RAM and insert it again, it power on.but after some day same problem? please give the answer (i have also changed RAM it's new.)
write a c programme to count the characters words and lines in a text book
what should i say in the interview if interviewer asks me "why did you choose IT instead of your core group?"
plz explain abt refrigeration r22 bitzer comprassors trouble shooting and maintenance
Tell me about urself? asked me qstns on my resume what about higher studies any plans? where do u find urself after 3-4
what is difference between Fault tolerance Vs fault avoidance
Why the secondary ip address of interface is not advertising in IGP cloud?