Mail Archives: djgpp/1999/05/13/03:16:37
Jan wrote:
> Endlisnis wrote:
> > ... maybe you didn't include stdlib.h or something (even then it
> > shouldn't get 1, it got some huge number for me).
>
> Thanks, <stdlib.h> was the problem, but I thought that "rhide" make things
> like this automatically, since I put the option "Use standard libraries" on.
That does not mean that it will include 'standard' h files for you, it just
means that it will link the standard libraries with your code. That means that
all of the functions from libc will be available, but they still have to be
properly prototyped. The problem is if a function is not prototyped, the return
value defaults to an 'int' which is interpreted much differently than a float.
So when atof returned the proper 'float' value, it was read out of memory (or
the register) as an integer bit pattern which gives irradic results (the results
are actually quite predictable, but not very useful or straightforward to
determine)
--
(\/) Endlisnis (\/)
s257m AT unb DOT ca
Endlisnis AT HotMail DOT com
ICQ: 32959047
- Raw text -