typedef und struct



  • Ich möchte wissen ob ich mit meinen Vermutungen richtige liege, weil mein C Buch mir keine Auskunft darüber gibt

    typedef struct
    {
    	float width ;
    	float height ;
    } Rectanglel;	// alias fuer die "namenlose" Struktur
    

    obiger Code ist doch C99 Konform - oder?

    typedef struct
    {
    	float width;
    	float height;
    } Rectanglel;	// Variable Rectangle der "namenlosen" Struktur
    

    auch C99 Konform - oder?

    struct
    {
    	int x;
    };
    

    nicht Standardkonform - oder?



  • alles richtig, allerdings meintest du das zweite bestimmt ohne "typedef"



  • Bashar schrieb:

    alles richtig, allerdings meintest du das zweite bestimmt ohne "typedef"

    ups... natürlich

    gemeint war:

    struct
    {
        float width;
        float height;
    } Rectanglel;    // Variable Rectangle der "namenlosen" Struktur
    

Anmelden zum Antworten