Hi All,
I need to get a value into an int variable from a double variable, and I keep getting errors.
The line I'm using is:
intValue1=dblValue1+dblValue2;
Is this possible, or is there a way around it?
Any pointers or help would be greatly appreciated.
Thanks
conversion from 'double' to 'int', possible loss of data
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
int main()
{
int x;
double y = 10.1;
double z = 20.2;
x = y + z; //conversion from 'double' to 'int', possible loss of data
cout << x << endl;
return 0;
}