Taking number as reference

Sir, In the clear bit function why we are taking ‘n’ as reference?

I am not getting your problem. Can u explain it.
if it is some hackerblock problem can u mention link
if it is a conceptual problem can u explain it

Can you watch bitmasking basics webinar?It is there.
Problem-To clear i th bit of number?

can u Mention link of webinar and timestamp when sir teaches about clearing ith bit.

Function is using call by reference because you want to change the value of n in the main function.
you have two choices
Choice 1

don’t use reference and return the value of n

Choice 2

use reference and automatically if value of n changes in function it will automatically update the value in the main function
.
.
.
.
.
Why we are doing this
if we don’t pass the value as reference then value of n in the clear bit function will change but value of n in the main function will not change.

Hope u get it. Hit like if u get it.
For getting knowledge about call by value of call by reference .

1 Like