Static Cast
This is the simplest type of cast that can be used. It is a compile-time cast. It does things like implicit conversions between types (such as int to float, or pointer to void*), and it can also call explicit conversion functions.
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