C++ Programmer Question: Download Questions PDF
Explain me what is implicit conversion/coercion in c++?
![C++ Programmer Interview Answer C++ Programmer Interview Question](https://globalguideline.com/public/images/interview/28.png)
Answer:
Implicit conversions are performed when a type (say T) is used in a context where a compatible type (Say F) is expected so that the type T will be promoted to type F.
short a = 2000 + 20;
In the above example, variable a will get automatically promoted from short to int. This is called implicit conversion/coercion in c++.
short a = 2000 + 20;
In the above example, variable a will get automatically promoted from short to int. This is called implicit conversion/coercion in c++.
Download C++ Programmer Interview Questions And Answers
PDF
Previous Question | Next Question |
Explain me what is virtual destructors? Why they are used? | Explain void* realloc (void* ptr, size_t size)? |