Y
Hacker News
new
|
ask
|
show
|
jobs
by
jki275
2301 days ago
C++ is not a strict superset of C anymore. You can't compile all C in a C++ compiler.
2 comments
leetcrew
2299 days ago
has c++ ever been a strict superset of c?
afaik,
int* arr = malloc(sizeof(int));
has never worked in c++.
link
jki275
2299 days ago
It's probably never been a strict superset really.
link
mrr54
2300 days ago
To use a trivial example:
int free;
link
leetcrew
2298 days ago
care to explain which language this doesn't work in (and why)? I'm curious. AFAIK, `free` isn't a keyword in either language and this is just declaring an int variable with a legal identifier (but not initializing it).
link
afaik,
has never worked in c++.