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?
0
votes
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
Related questions
0
votes
Q: What is the difference between getc(), getchar(), getch() and getche().
asked
Jan 12
in
C Plus Plus
by
GeorgeBell
c-interview-questions-answers
0
votes
Q: What is the difference between macro and functions?
asked
Jan 11
in
C Plus Plus
by
GeorgeBell
c-interview-questions-answers
0
votes
Q: What is the difference between the local and global variables in C?
asked
Jan 11
in
C Plus Plus
by
GeorgeBell
c-interview-questions-answers
0
votes
Q: What is the difference between near, far and huge pointers?
asked
Jan 9
in
C Plus Plus
by
GeorgeBell
c-interview-questions-answers
0
votes
Q: What is the difference between including the header file with-in angular braces < > and double quotes ” “?
asked
Jan 9
in
C Plus Plus
by
GeorgeBell
c-interview-questions-answers
0
votes
Q: What is the difference between goto and long jmp( ) and setjmp()?
asked
Jan 9
in
C Plus Plus
by
GeorgeBell
c-interview-questions-answers
0
votes
Q: What is the difference between ‘g’ and “g” in C?
asked
Jan 6
in
C Plus Plus
by
GeorgeBell
c-interview-questions-answers
0
votes
Q: What is the difference between #include "..." and #include <...>?
asked
Jan 6
in
C Plus Plus
by
GeorgeBell
c-interview-questions-answers
0
votes
Q: Difference between const char* p and char const* p?
asked
Jan 4
in
C Plus Plus
by
GeorgeBell
c-interview-questions-answers
0
votes
Q: What is the difference between global int and static int declaration?
asked
Jan 4
in
C Plus Plus
by
GeorgeBell
c-interview-questions-answers
...