#include // ALWAYS USE CONST // this is what happens when you don't void experiment(int a, int b, int c, int d) { // if a is less than b, it is very bad // if c is less than d, it is also very bad if (a < b || c < d) print("very bad\n"); // if c is between 3 and 7 or between 13 and 17, it is sort of ok if (c >= 3 && c <= 7 || c >= 13 && c <= 17) print("sort of ok\n"); // if b is equal to 9 it is a disaster if (b = 9) print("disaster\n"); // if a, b, and c are all different, it isn't the end of the world if (a != b && a != c && b != c) print("it isn't the end of the world\n"); } This function works as intended, except for one critical part. No matter what inputs I give it, it always tells me it is a disaster. If I give b the value 3, it says "disaster", and if I look, I find that b actually changed to 9 just to make it true. Of course the problem is that I accidentally typed b = 9 instead of b == 9. This happens a lot, and can take a long long time to uncover. The correct thing to do is to start the function like this void experiment(const int a, const int b, const int c, const int d) { ... a, b, c, and d are not supposed to change during this function. Saying const makes the compiler do all the work of making sure they don't. It will now give me an error message as a warning with this and many other subtle errors.