explicit keyword in C++
Explicit Keyword in C++ is used to mark constructors to not implicitly convert types in C++. It is optional for constructors that take exactly one argument and work on constructors(with a single argument) since those are the only constructors that can be used in typecasting. ``` #include <iostream> class C { public: explicit C(int) { std::cout << "i"; } C(double) { std::cout << "d"; } }; int main() { C c1(7); C c2 = 7; } /* Output id */ ```