Re: advantage of using typedefs



On 28 Jan 2006 00:50:55 -0800, in comp.lang.c ,
"junky_fellow@xxxxxxxxxxx" <junky_fellow@xxxxxxxxxxx> wrote:

(concerning typdef'ing)

>Thanx for your reply, Emmanuel. But if this is the case (ie we need
>the biggest possible unsigned integer to hold offset ) then why not declare
>unsigned long long offset;

Because then its size would vary from platform to platform, and on a
c90 implementation it would be an error. Some implementations spell
"long long" as "__int64", others don't support it at all etc etc.

>I believe unsigned long long should be highest possible integer type ?
>Or am I wrong ?

You're right, but the size of long long varies from platform to
platform
Mark McIntyre
--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan

----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
.



Relevant Pages

  • Re: advantage of using typedefs
    ... >>the biggest possible unsigned integer to hold offset) then why not declare ... > Because then its size would vary from platform to platform, ... Yes, but if you want the biggest unsigned integer type, you have to ...
    (comp.lang.c)
  • Re: advantage of using typedefs
    ... but the size of long long varies from platform to ... >>Yes, but if you want the biggest unsigned integer type, you have to ... But if this is the case (ie we need the biggest possible unsigned ... necessarily the longest unsigned integer type. ...
    (comp.lang.c)
  • Re: Playing around with byte order
    ... code computes at runtime the byte-order of the unsigned integer, ... most people put all their standard header inclusions together, ... unsigned char GetByte(const unsigned * const pu, ... unsigned readLSBplus_offset(long unsigned number, size_t offset); ...
    (comp.lang.c)
  • Re: advantage of using typedefs
    ... Emmanuel Delahaye wrote: ... > biggest possible unsigned integer. ... unsigned integer to hold offset) then why not declare ...
    (comp.lang.c)
  • Re: advantage of using typedefs
    ... > integer to hold offset) then why not declare unsigned long long ... > Because then its size would vary from platform to platform, ... If you want the biggest possible ... But this thread was about why one would use typedefs, and one reason ...
    (comp.lang.c)