From: cberry AT cinenet DOT net (Craig Berry) Newsgroups: comp.os.msdos.djgpp Subject: Re: Questions Date: 6 Oct 1997 20:55:31 GMT Organization: Cinenet Communications,Internet Access,Los Angeles;310-301-4500 Lines: 29 Message-ID: <61bj83$ek4$1@marina.cinenet.net> References: <343927E9 DOT CFEE68C0 AT worldonline DOT nl> NNTP-Posting-Host: hollywood.cinenet.net To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk 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."