In many programs, I see statements with the identifiers FALSE
and false
. Is there any difference between them in the context of C++?
Also in so
FALSE
is not defined in the standard. Only false
is. true
and false
are called "Boolean literals", and are keywords in C++.
FALSE
is sometimes defined as a macro. You can't rely on it being present on a standards-compliant environment as it is not part of the standard.
In other words, the following program is valid C++
:
#include
#define FALSE 1
int main()
{
bool a = false;
bool b = FALSE;
std::cout << a << " " << b << std::endl;
return 0;
}
and it will print 0 1
as expected. FALSE
is not a privileged symbol in any way.