10 ms·
By the way, in the original C language by Dennis R. struct member names were in a kind of global namespace of all such names. So for instance if we had a str
by kazinator 11y ago
By the way, in the original C language by Dennis R. struct member names were in a kind of global namespace of all such names. So for instance if we had a
struct stat { ... int st_ino; ... }
struct dirent { ... int d_ino; ... } d;
It was possible to access:
d.st_ino;
The compiler would just use the st_ino offset from struct stat, and generate an access into the struct bar b.
This is the main reason members have funny prefixes in Unix structures. Once upon a time they had to, to prevent clashes.