cout problem
This is probably a simple problem but I can't figure it out.
1 2 3 4
|
const int phantom_size = 20; //mm
const int phantom_res = 200;
float voxel_size = phantom_size/phantom_res;
cout << "voxel_size = " << voxel_size << " mm^3" << endl;
|
When I compile this the output is voxel_size = 0 mm^3 no matter what values I have for phantom_size and phantom_res. Why is the output doing this?????
|
float voxel_size = float(phantom_size)/float(phantom_res);
|
or
1 2
|
const float phantom_size = 20; //mm
const float phantom_res = 200;
|
Topic archived. No new replies allowed.