I am learning C.
I have been using a notepad running Vista, and have run into a problem sending a float value to a function with returning the correct value. If I use integers it works.
The program works ok on XP and Ubuntu.
Any one knows of issues with Vista and code::blocks compiling 'float'?
Any help will be most appreciated.
/*10 feb 2011 funnctions float*/
#include <stdio.h>
float x = 3.5, y = 65.11, z;
float half_of(float k);
main()
{
z = half_of(x);
printf("The value of z = %f\n", z);
z = half_of(y);
printf("The value of z = %f\n", z);
}
float half_of(float k) /* values for x and y are arriving here ok.*/
{
return(k/2);
}