I'm new to c / c BUT not new to programing, I know php vary well. Well, on to my question. I'm writing a physics calc, the user enters a Vi and Angle and it gives them the rest of the info, here's my php version. I got my c one to work BUT it cuts everything past the decimal off... If some one could show me how to get it to not cut them off if it is I dint know what I would do.
case IDC_GO:
{
float y, x, h, t, j, l;
float pi = 3.14159265359;
float vi = GetDlgItemInt(hwnd, IDC_VITEXT, NULL, FALSE);
float a = GetDlgItemInt(hwnd, IDC_ANGLETEXT, NULL, FALSE);
a = ( a / 1 ) * ( pi / 180 );
y = vi * sin(a);
x = vi * cos(a);
h = -y / -9.81;
t = h * 2;
j = ( y * h ) + ( -4.905 * pow(h,2) );
l = x * t;
a = ( a ) * ( 180 / pi );
SetDlgItemInt(hwnd, IDC_VITEXT, vi, TRUE);
SetDlgItemInt(hwnd, IDC_ANGLETEXT, a, TRUE);
SetDlgItemInt(hwnd, IDC_VXITEXT, x, TRUE);
SetDlgItemInt(hwnd, IDC_VYITEXT, y, TRUE);
SetDlgItemInt(hwnd, IDC_TIMETEXT, h, TRUE);
SetDlgItemInt(hwnd, IDC_FULLTIMETEXT, t, TRUE);
SetDlgItemInt(hwnd, IDC_HEIGHTTEXT, j, TRUE);
SetDlgItemInt(hwnd, IDC_LENGTHTEXT, l, TRUE);
}
break;
Heres a link the the .exe