Here are some of the scenarios where the implicit type conversion can be unintuitive and tricky.
- implicit conversion between int, float and bool
#include <iostream> void print(char x){ std::cout << "in the print method that has char arg\n"; } void print(int x){ std::cout << "in the print method that has int arg\n"; } void print(bool x){ std::cout << "in the print method that has bool arg\n"; } int main(){ int x =1; char ch = 'c'; char * c = &ch; print(*c); // in the print method that has char arg print(*c+1); //in the print method that has int arg return 0; }