Prefer initializer list for variable initialization
Implicit conversion is a convenience that C++ offers to programmers. However, sometimes this can cause unexpected results. It is always a good rule of thumb to be explicit when expressing your intent. The following code snippet demonstrates how implicit conversion (both narrowing and widening) can be useful and can avoid casting between data types manually. #include<iostream> int main() { int num = 10.2; // Implicitly converts float to num which is fine at the cost of loosing precision float radius = 10; // Implicity converts int to float....