Code::Blocks Forums

User forums => Help => Topic started by: Malcolmj. on February 10, 2011, 01:32:18 pm

Title: Vista problem with float
Post by: Malcolmj. on February 10, 2011, 01:32:18 pm
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);
}


Title: Re: Vista problem with float
Post by: Jenna on February 10, 2011, 01:42:11 pm
Code::Blocks is an IDE not a compiler !
Your question is compiler specific and therefore violating our forum rules.
This forum/website is dedicated to C::B related questions only.

Please ask it in an appropriate C/C++ - forum.

Topic locked !