static_cast<> not converting my variable ?

So I created a program that ask the user's height in integer and display it in foot inches. but when I convert 'inches' (the variable that holds the height in inches integer) the variable wont convert into double

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
  #include<iostream>

using namespace std;

int main()
{
	int inches;

	cout << "Enter your height in inches: ";
	cin >> inches;

	static_cast<double>(inches);
	const double INCHES_TO_FEET = inches / 12;

	cout << "Your height in terms of feet is: " << INCHES_TO_FEET;

	cin.ignore();
	cin.get();
	return 0;
}


example output should be :

Enter your height in inches: 25
Your height in terms of feet is: 2.0833

but instead I only get 2, which means the variable was not converted. Or am I doing something wrong ?
The result of the cast is double. On line 12 you don't use the result hence nothing will happen. In order to use the result you need to use it on line 13:

const double INCHES_TO_FEET = static_cast<double>(inches) / 12;
Topic archived. No new replies allowed.