c++ cast to type of variable
x = static_cast<decltype(x)>(y);
c++ cast to type of variable
x = static_cast<decltype(x)>(y);
type casting in cpp
int main()
{
int a=20 , b= 25 , c= 19;
int sum = a + b + c;
float ave = (float) sum / 3; //this is called type casting (float) sum
cout<<"Average is : "<<ave<<endl;
return 0;
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us