Im new to C++ and i'm not sure why the output for this code is 8 and not 8.25?
can someone explain why this code outputs an int not a double?
Thanks :)
#include "stdafx.h"
#include <iostream>
int main()
{
double x = 8.25;
int y;
y = x;
double z = static_cast<double>(y);
std::cout << z << std::endl;
return 0;
}