What is stored in the variable below?
int status = f ? true : false;
I tried to use it but cannot tell what is stored in the variable status.
What is stored in the variable below?
int status = f ? true : false;
I tried to use it but cannot tell what is stored in the variable status.
This is conditional operator , that it depend upon your f
for it to be true
or false
.
It's like,
if(f)
status =true;
else
status = false;