Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

int arr[] = {1,2,3,4}
int *ptr=arr;

*(arr+3) = *++ptr + *ptr++;

Final contents of arr[]

Answer Posted / anag

*(arr+3)------>arr[0][3] that means the there is any chnage
in the last value of an array
{1,2,3,--}

we know ++ has higher prededence than * so
*++ptr---->*(++ptr)
*(++ptr)----> increment in the location after that it point
to the value
it represent the second location of an array
* represent the value at this address
the value at the second location is 2.
in the second expression first it refer the value after
that it increment in the location
ptr currently points to the second location . ptr holds
that location for the second expression * represent the
value at that location that is 2.
so 2+2->4
{1,2,3,4} ----------->ans
suppose if we add a another expression after this that *ptr
then it print the value 3
because previous expression increment the location of the
value
Thank you

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why can’t we compare structures?

1283


Is it possible to execute code even after the program exits the main() function?

1350


What is variable initialization and why is it important?

1273


Explain heap and queue.

1096


main use of recursive function a) processing speed high b) reduce program length/reduce repeated statements c) if you do not, use iterative methods like, for, while or do-while d) all the above

1106


What are the types of data structures in c?

1160


Tell me what is null pointer in c?

1086


What do you mean by recursion in c?

1117


why we wont use '&' sing in aceesing the string using scanf

2375


What is type qualifiers?

1140


What is a function in c?

1591


Explain the meaning of keyword 'extern' in a function declaration.

1155


Is it better to bitshift a value than to multiply by 2?

1094


What are called c variables?

1072


What are the features of the c language?

1092