Skip to content

C11 Anonymous structures and unions #394

@thradams

Description

@thradams

C11 Anonymous structures and unions

https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1406.pdf

struct point { float x, y, z; };

struct location {
    char* name;
    struct point;
};

int main()
{
    struct location location = {};
    location.x = 1;
    location.y = 2;
}

only this is standard

struct location {
    char* name;
    struct { float x, y, z; };
};

int main()
{
    struct location location = {};
    location.x = 1;
    location.y = 2;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions