Base address doubt

sir base address of an array means address of first element of array

so while finding the auto first=lower_bound(a,a+n,2)-a
int this sir said we need to subtract base address so he subtracted a
and got no of boxes before lower bound

why i am getting an address returned and not the no of boxes as sir got when i subtract -a[0] from lower_bound

plzz clear my doubt


code link of prateek bhaiya

hey @yatin, beacause a[0] is giving value instead of address in the ide. So (address- value), giving you address. You should use &a[0] instead of a[0].

But a is giving address only,(address- address) is giving you value.

ohh sryy sirr such a terrible mistake,thank u sir

hey @yatin your query is resolved. Please mark this doubt as resolved and rate me on the basis of your experience.
rating option will appear when to mark this doubt as resolved