[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] Hvilket sprog



On Tuesday 29 June 2004 22:56, donald_j_axel wrote:

> > Jeg ved ikke hvilken C standard jeg benytter, jeg er dog ikke
> > helt klar over hvilke ting der hører i hvilke standarder.
> >
> > Jeg kunne dog tænke mig at
> >
> > typedef struct test_
> > {
> > 	...
> > } test;
> >
> > test* testptr;
> >
> > og
> >
> > struct test
> > {
> >
> > };
> >
> > struct test* testptr;
> >
> > Ligger i 2 forskellige standard specifikationer?
>
> Nej nej da, uha. Hvor kan du tro det? ANSI versionen af
> "The C Programming Language" fortæller, at typedef er
> medicinen mod den kringlede syntax i "complicated declarations".

Det her begynder at blive flovt, da den bog er min nyeste erhvervelse!

> Nogen anvender typedef fordi de synes
>
>   test* testptr;
>
> ser pænere ud, især i fcn prototypes:
>
>    int myfunc(struct test *tptr);
>
> versus
>
>    int myfunc(test tptr);
>
> Men i eksempel 2 kan du ikke se, hvad test er. I anbefalet
> programming style skulle der MINIMUM have stået
>
>    int myfunc(FILE *tptr);
>
> hvor FILE (eller TEST) antyder, at her er tale om en MACRO,
> ellers bliver det lige så svært at debugge som C++, eller
> Java, og hvor er vi så henne;-)

Ja den er jeg med på, men sjovt nok duer "typedef'en", i C++ uden typedef.

Dvs.

struct Test
{ 
  ..
};

Test t;

Men hvor er de åbentlyse forskelle så i de forskellige ISO C udgaver?

Bo


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 22:43 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *