Data Conversion Warning

Hi, There data conversion warning from double to int when compile, is there anyway to solve this?

double a = 100.30;
int i = (int)a;

this is the syntax.
iphoneAsked:
Who is Participating?
 
jkrCommented:
Sorry, the last part should have been

double a = 100.30;
int i = static_cast<int>(a);
0
 
jkrCommented:
Just ignore the warning if all you want is to convert a double to an integer or use

double a = 100.30;
int i = retinterpret_cast<int>(a);

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.