advantage of using typedefs



I was looking at the source code of linux or open BSD. What I found
that lots of typedefs
were used. For example, consider the offset in a file. It was declared
as
off_t offset;
and off_t is typedefed as
typedef long off_t;

I wanted to know what advantage do we get by typedefs ? Why we did not
declare
offset simply as
long off_t;

Similar is the case with size of file and so on.....

Does any one has any clue of why do we use typedefs in such cases ?

Thanx for any help advance ....

.



Relevant Pages

  • Re: advantage of using typedefs
    ... consider the offset in a file. ... > I wanted to know what advantage do we get by typedefs? ... Prev by Date: ...
    (comp.lang.c)
  • Re: Forward declaration and typedefs
    ... > For some time I've been using typedefs for STL containers for reasons ... > forward declare it: ... > In general it's not recommended to inherit from STL containers because ... header in your header, and you've successfully typedef'd it there, ...
    (comp.lang.cpp)
  • Re: Can one class have two names?
    ... "Gianni Mariani" wrote in message ... > JustSomeGuy wrote: ... > One thing he left out was typedefs. ... While you can declare x in a forward declaration as a class, ...
    (comp.lang.cpp)
  • Re: Strange XCode Linking Error (multiple definitions)
    ... There are two disadvantages to using typedefs. ... Secondly, you can't forward declare a typedef type, whereas ... Usually I see "typedef struct" ... I'd try to limit it to class scope. ...
    (comp.sys.mac.programmer.help)