newbie warning
OS Ubuntu, I use a couple of different IDEs and most of them give different compiling warnings for this when compiled as c, as c++ it works
undefined reference to `trunc'
warning: implicit declaration of function ‘trunc’
warning: incompatible implicit declaration of built-in function ‘trunc’
and trunc is not the only one, I have problems with round(), floor() and exp()
I searched around, but can't seem to find a solution
[CODE=c]#include <stdio.h>
#include <math.h>
double cio(double a);
int main(void)
{
///
return 0;
}
double cio(double a)
{
double c1=trunc(a);
while(c1>1)
c1/=10;
return c1;
}[/CODE]
OS Ubuntu, I use a couple of different IDEs and most of them give different compiling warnings for this when compiled as c, as c++ it works
undefined reference to `trunc'
warning: implicit declaration of function ‘trunc’
warning: incompatible implicit declaration of built-in function ‘trunc’
and trunc is not the only one, I have problems with round(), floor() and exp()
I searched around, but can't seem to find a solution
[CODE=c]#include <stdio.h>
#include <math.h>
double cio(double a);
int main(void)
{
///
return 0;
}
double cio(double a)
{
double c1=trunc(a);
while(c1>1)
c1/=10;
return c1;
}[/CODE]
Comment