|
|
Log in / Subscribe / Register

Losing the magic

Losing the magic

Posted Jan 3, 2023 9:56 UTC (Tue) by geert (subscriber, #98403)
In reply to: Losing the magic by tabberson
Parent article: Losing the magic

struct foo {
        ...
        struct bar embedded;
        ...
};
If you have a pointer to the "embedded" member of type "struct bar", you can convert it to a pointer to the containing "struct foo" using the container_of() macro.


to post comments


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds