I still think this is an error in the Pelles C compiler.
This program:
#include <stdio.h>
void printDoubleBits(double d) {
int i, j, cnt = 0;
char *c = (char*)&d;
Type: Posts; User: oogabooga
I still think this is an error in the Pelles C compiler.
This program:
#include <stdio.h>
void printDoubleBits(double d) {
int i, j, cnt = 0;
char *c = (char*)&d;
@manasij: Now that I think about it, I see that you're right. :) I wonder what the difference is between the two compilers.
That's certainly true about floating point values generally, but it's not the problem in this case since the numbers are all integral (albeit contained in a double).
I forgot to mention that main...
Your program works correctly with gcc, so it appears to be a Pelles C problem (I've encountered other problems with it). gcc is much better. You can use an IDE like Codeblocks with it (or others)....