Is it because the string class has == as an overloaded element and therefore can perform this action?
You're right. Ordinary type values char *do not have overloaded operators. To compare the strings of C,
if (strcmp(argv[1], "-i") == 0) {
...
}
Comparing strings the way you did it (directly with ==), you compare the values of pointers. Since "-i"this is a compile-time constant, and argv[1]is something else, they will never be equal.