C++

C++ - Operators

Basic Operators

Posted by Rico's Nerd Cluster on January 7, 2023

Basic Operators

  • a == b == c doesn’t do what you want. Do (a == b && b == c) instead. It’s equivalent to:
1
2
3
int a = 5, b = 5, c = 5;
bool res = a == b;
res = res == c;