I am curious to motivate this behavior in C. Was it intentional or accidental?
struct tpoint // tpoint is not a type name { int x, y; }; typedef struct tpoint Point; // point is a type name.
I want to know why Ritchie or the standard committee chose this behavior.
This is a thing with names. Thus, I have struct a, enum a, union aand none of them is ambiguous. This helps in developing frameworks that can have similar type names, but they can get confused quickly.
struct a
enum a
union a
In reading C language development , when Dennis Ritchie discusses embryonic C, he describes his intention for struct:
struct
, , , .
, " ↔ ". C (a struct " " ).
, ++ struct class, , . A class - - , , .
class