Mail Archives: djgpp/1997/10/06/19:04:03
Reinier Heeres (rwh AT worldonline DOT nl) wrote:
: I have 2 questions:
: -When does a floating point exception occur, I seem to get them every
: other time I run my little 3D object viewer...
The most common cause is division by zero. Check for cases in your code
where these might occur and find a way around them.
: -Is the 'char' type in DJGPP the same as an 'int'? It seems to take 4
: bytes in my structure, and if so, isn't there a type that defines 1 byte
: (a 'char' in borland C)
Answer 1: No, it's not the same as int, it's a char.
Answer 2: In DJGPP, sizeof(int) = 4, sizeof(char) = 1. The latter
is always true by definition, I believe.
Answer 3: DJGPP will by default optimize your struct layout so that
fields begin on even byte boundaries. This can leave
'dead space' in your structs. Look up 'struct packing'
if you want to defeat this, but be careful -- the memory
savings carry a performance penalty, and can cause lib
compatibility problems.
Hope this helps!
---------------------------------------------------------------------
| Craig Berry - cberry AT cinenet DOT net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| Member of The HTML Writers Guild: http://www.hwg.org/
"Every man and every woman is a star."
- Raw text -