[LCP]typedefs in .h

Emil Tantilov emocom at yahoo.com
Sat Jan 19 09:33:14 UTC 2002


> But let me refine that answer Emil.
> 
> The method you were given will give you the "actual"
> type in THIS (ie:
> some specific) implementation. You can also examine
> the headers
> themslves (and remember, you can use an option
> specifying that these
> "hidden" things be expanded in the compile listing).
> They aren't
> "buried", only seems that way because the default is
> "don't expand and
> show me".
> 
> BUT --- there is no ACTUAL type for these things in
> C itself. That is
> the whole purpose of having them as abstract types
> defined via typedefs
> in headers. It makes your C source code independent
> of the way these
> must be defined for some specific implementation.
> Since any actual
> compile is for some specific implementation, as long
> as the the right
> header libraries* are used for that implementation,
> everything will work
> out WITHOUT any need to edit the source code.
> 
> Proper coding technique is for your code to make no
> assumptions about
> things that are not defined in C like "how long is
> an integer"
> 
> Mike

 I agree and understand the purpose of things being
made the way they are. However (I should've asked the
question in a different way perhaps ...) if I try to
display the result I *will* need to know the type,
otherwise the result won't be accurate (let's say if I
display number instead of text or char ...). In this
case fstat(), I can't display st_dev, not to mention I
have no idea what it represent and in what format ...

Emil

__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/



More information about the linuxCprogramming mailing list