Compilation error problem from floating point literals
Brought to you by:
lowellboggs
In the following program
#include <stdio.h>
int main()
{
double x=.5;//gives compile time error
//double x=0.5; //works if 0 put before .5
printf("%lf\n",x);
}
When compiled using: cov++ -EXT .cxx .c++ -c tt1.cxx
I get the compilation error:
tt1.cxx: In function `int main()':
tt1.cxx:6: parse error before `.'
It requires a 0 before decimal i.e. double x=0.5 to fix
this
problem. This is a bug because gcc/g++ does not complain
about it.
Yogesh
Logged In: NO
Yep, that sounds like a bug. I'll look into it.