logo

Recursive data types are impossible. But why?

#include <stdio.h> #include <stdlib.h> typedef struct Foo { int y; } Foo; typedef struct Node { int x; struct Node next; // this won't compile } Node; int main(int argc, char **argv) { printf("%zu", sizeof(Node)); return 0; }