Home
Recent Q&A
Java
Cloud
JavaScript
Python
SQL
PHP
HTML
C++
Data Science
DBMS
Devops
Hadoop
Machine Learning
Azure
Blockchain
Devops
Ask a Question
What is the difference between type casting and type conversion?
Home
C Plus Plus
What is the difference between type casting and type conversion?
asked
Jan 11
in
C Plus Plus
by
GeorgeBell
What is the difference between type casting and type conversion?
c-interview-questions-answers
Please
log in
or
register
to answer this question.
1
Answer
0
votes
answered
Jan 11
by
GeorgeBell
Type Casting
Type Conversion
The data type is converted to another data type by a programmer with the help of a casting operator.
The data type is converted to another data by a compiler.
It can be applied to both compatible data types as well as incompatible data types.
Type conversion can only be applied to only compatible data types.
In Type casting in order to cast the data type into another data type, a caste operator is needed
In type conversion, there is no need for a casting operator.
Type casting is more efficient and reliable.
Type conversion is less efficient and less reliable than type casting.
Type casting takes place during the program design by the programmer.
Type conversion is done at compile time.
Syntax:
destination_data_type = (target_data_type) variable_to_be_converted;
Syntax:
int a = 20; float b; b = a; // a = 20.0000
...