Answers for "static cast in c++"

C++
0

static_cast c++

#include <iostream>
using namespace std;
int main()
{
    float f = 3.5;
    int a = f; // this is how you do in C
    int b = static_cast<int>(f);
    cout << b;
}
Posted by: Guest on January-10-2022

Browse Popular Code Answers by Language