Why does C++ allow an integer to be assigned to a string?

Because string is assignable from char, and int is implicitly convertible to char.

Leave a Comment