Horje
c++ cast to type of variable Code Example
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;
}




Cpp

Related
how to return char* from function in c++ Code Example how to return char* from function in c++ Code Example
shuffle elements c++ Code Example shuffle elements c++ Code Example
default access specifier in c++ Code Example default access specifier in c++ Code Example
c++ check if char is number Code Example c++ check if char is number Code Example
c++ random number 0 to 1 Code Example c++ random number 0 to 1 Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8