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 DIFFERENCE BETWEEN ART & VECTOR QUANTISATION BASED ON THEIR APPLICATION IN NEURAL NETWORK
please send me latest Aptitude Test paper
How do trains go around bends?
What are the inspection and test plan for lift materials?
Prepare the UGC CSIR net question papers those are enough. The question paper will be of 50 questions in size each 3 marks and with a negative of -1 for each wrong answer
iam from engineering information technology ... can i write group 1 exams??
Can u send me a sample Final year CSE student 'RESUME' for campus placement to following mail id: aspnetworks@gmail.com
pls send me the e-book for verbal and non verbal reasoning of R S aggarwall
how to send request to the direct server rather than proxy server
what books to prepare for atc please
i want to knw about what is lead,survey, oppertuinty , questionary,sales order,quotation,marketng conecpts in deatil and how it works in SAP CRM. Please send to my email- id as soon as possible. Thanks in Advance . :) nimi.nimisha1@gmail.com
DVC2000 performent: travel ??? and not output signal
i have passed my gRaduation in BCA and now im looking for post graduation from Germany, i haver passed my ielts wth 6 band, nw plz tell me some question that wll ambessay ask
how 2 write a program of this pattern usin for loop?? 1 2 3 4 5 6 7 8 9 10
what in 4th and 5th normal form ??