Skip to main content

Posts

Showing posts with the label differentiate between POP and OOP

Discuss automatic conversion and casting with example? Differentiate between POP and OOP.

Discuss automatic conversion and casting with example? Automatic conversion and casting are two ways to convert values from one type to another in C++. Automatic conversion: Automatic conversion, also known as implicit type conversion, occurs automatically when a value of one type is used in an expression that requires a different type. For example, when a 'float' is used in an expression that requires an 'int', the 'float' will automatically converted to an 'int'.                float a= 3.14;               int b = a; // automatic conversion from float to int         2. Casting: Casting, also known as explicit type conversion, allows you to explicitly convert a value              from one type to another using a cast operator. There are several cast operators in C++, including                's...