+ 3
What does this code mean?
How does the following code do? What does it mean? : static_cast<int>
4 Answers
+ 7
static_cast in C++ Type Casting operators. ... Static Cast: This is the simplest type of cast which 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 (or implicit ones).
+ 3
This is a static integer conversion, it is the same as int a = 3; or something.
+ 1
Almir
I know that is data type, but I dont know how to use?
0
#include <iostream>
int main() {
int a = 4;
int b = static_cast<int>(4);
// same thing above a == b
}