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
explain inflation ,deprication ,time of value & pf tariff
Discuss the various process operations, clearly stating what is involved in each process operation.
can 25mm thik and 8.5x8.5 size cast iron plate can bear a weight of 250 tons if it can what would be the compostion
a steel bar 1' inch square 6' long is to be used as a column.ends are free to rotate put may not be displaced.stress is limited to 30,000 PSI
how is the config take place and from reciever side how will process the data into internal table
how to generate linked implementation of sparse matrix?
What are the main differences between the engines in jet fighters and the engines in jet airliners; which type of engine is the more efficient, and (qualitatively) why?
Explain diffrent parts of an instruction format.
what is the effect of low frequency(say 48Hz) on TUrbo- Generator set when running for a prolonged period?
As a good company employee, can you report your supervisor to the company management if he or she is going against the company interest in his or her actions?
need tcs questn papers from 2007 to 2009 plzzzmail to 9015.rama@gmail.com its urgent
What is the difference between "type testing" and "product qualification"?
Apply Newton?s method to compute the approximate value of root 2. Start the iteration from x0=1, and obtain two iterations.
Why is not creat swap partition in my system.
Explain how to share outlook calenders and the type of permissions you need to assign?