Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how convert int to double with Diab C/C++

Status
Not open for further replies.

1230

Programmer
Apr 23, 2001
5
FR
i have no error and warning during compile, but when my program is running, there is an error in conversion int to double, like this:

double a=0.0;
int b=1;

a =(double)b; there is crash..........
a=(double)b*0.1/0.1 there is crash..........


the error should be a compiler option, but i can't find it.
 
The code you have written is perfectly all right and should not be giving any errors if that is all wirtten in the program.

However if this is only a bit of your code, Refer to other parts of your code for being errorneous, this code must work, there is no relation of compiler settings whatsoever for type conversions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top