+ 3
How the '&' operator works in if-else statement and What is the difference between '&' and '&&' in logical operation.
Suppose :- int a=8,b=8; if(a==8 & b==a) return 1; Earlier I thought that this will be a error but when I checked it actually returns 1, So what is the difference with '&&'. I think it takes true to be 1 and false to be 0 , then performs bitwise operation and again converts the results to boolean.Did I am correct??
1 Réponse
+ 9
You should check this question, it is exactly what you are asking 😉 :
http://stackoverflow.com/questions/5564410/difference-between-and