Write brief note on Cast Operator.
Answers
Answered by
0
C++ Casting Operators. Advertisements. A cast is a special operator that forces one data type to be converted into another. As an operator, a cast is unary and has the same precedence as any other unary operator. The most general cast supported by most of the C++ compilers is as follows − (type) expression.
Answered by
0
Cast Operator
- A casting is a kind of operator which is used to convert one primitive data type to another.
- Below is the simple example to convert double to integer data type using cast operator.
For Example:
double d = 20;
int i;
i = (int) d; where ‘int’ is the cast operator.
The given input value 20 which is double and we converted the input which is double to integer using the cast operator int.
Similar questions
Environmental Sciences,
7 months ago
History,
7 months ago
Computer Science,
1 year ago
Computer Science,
1 year ago
Math,
1 year ago
Math,
1 year ago