0
Why is '&' used
7 odpowiedzi
+ 3
In C/C++ '&' is aslo known as reference operator which is used to get pointer address of a variable
+ 1
Thanks
+ 1
& symbol can also mean 'address of' operator in C/C++, it's contextual. You should at least clarify your question because you didn't tag any language - while you took 3 courses (how would anyone know which?), and no code was included to point out clearly where it is used.
For future reference, please follow this guide on posting decent question 👍
https://www.sololearn.com/Discuss/333866/?ref=app
+ 1
There are two meaning
'&' is Address Extraction Operator. This is a unary oprt in C/C++/Java. It returns the address (memory location in which variable stored) of the variable on which it applied.
Example int n=10
&n gives you the address of location where n is stored
This is also a Binary oprt, that's called Bitwise AND oprtr.
0
Please clear my doubt
0
“&” is used for many things, to say “And”, in JS (Javascript) is used for
Logical Operators
“&&” Returns true, if both operands are true.