Hacker News new | past | comments | ask | show | jobs | submit login

I found another difference between C and C++ recently. C++ compiles the code in the following post ok, but C doesn't.

https://old.reddit.com/r/C_Programming/comments/bn04w0/confu...

In short, for "typedef struct bar bar;", C views "bar" as an incomplete type, but C++ doesn't.




That doesn't sound right. I think the difference is that C++ doesn't treat that as an array declaration so it doesn't require a complete type.


What is the root cause for the difference?




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: