Author Topic: typedef struct name_ {} name;  (Read 10 times)

acbaile

  • Jr. Member
  • **
  • Posts: 89
    • View Profile
typedef struct name_ {} name;
« on: December 07, 2018, 06:15:11 PM »
    In C, when i need to define pointer to a structure inside structure, i need to give additional name with postfix:

        typedef struct name_ {
            struct name_ * next;
        } name;

    Must be, you already resolved this redundancy in C2, and you can simply specify struct type name inside struct:

        typedef struct {
            name * next;
        } name;


lerno

  • Full Member
  • ***
  • Posts: 211
    • View Profile
Re: typedef struct name_ {} name;
« Reply #1 on: December 07, 2018, 06:23:48 PM »
Yes, that works in C2.

On a completely different note: please change the special font you're using. It makes your texts quite unreadable.