Syntax of static_cast
static_cast <dest_type> (source);
The return value of static_cast will be of dest_type.
static_cast in C++
A Cast operator is a unary operator which forces one data type to be converted into another data type.
C++ supports 4 types of casting:
- Static Cast
- Dynamic Cast
- Const Cast
- Reinterpret Cast
This article focuses on discussing the static_cast in detail.
Contact Us