top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is implicit conversion in C++ ?

+2 votes
340 views
What is implicit conversion in C++ ?
posted Mar 6, 2015 by Vikram Singh

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

Implicit conversions are automatically performed when a value is copied to a compatible type. For example:

short a=2000;
int b;
b=a;

the value of a is promoted from short to int without the need of any explicit operator. This is known as a standard conversion. Standard conversions affect fundamental data types, and allow the conversions between numerical types (short to int, int to float, double to int...), to or from bool, and some pointer conversions.
go through this link for more details: http://www.cplusplus.com/doc/tutorial/typecasting/

answer Mar 22, 2016 by Shivam Kumar Pandey
Similar Questions
+1 vote

What type of conversion is not accepted in C and why?
a) char to int
b) float to char pointer
c) int to char
d) double to char

+1 vote

High level object oriented languages have support of interfaces. What is the best way to create interfaces in C++ ?

...