Google News
logo
CPP - Interview Questions
What is the difference between equal to (==) and Assignment Operator (=)?
In C++, equal to (==) and assignment operator (=) are two completely different operators.
 
* Equal to (==) is an equality relational operator that evaluates two expressions to see if they are equal and returns true if they are equal and false if they are not.
 
* The assignment operator (=) is used to assign a value to a variable. Hence, we can have a complex assignment operation inside the equality relational operator for evaluation.
Advertisement