Hacker News new | ask | show | jobs
by ReleaseCandidat 1650 days ago
We are talking about the question if C is a subset of C++. `new` certainly isn't a part of C, so also not an element of the intersection of C and C++.

Idiomatic C code doesn't explicitly cast the return value of malloc

    foo *bar = malloc(sizeof *bar);
C++ did AFAIK never (certainly not with C++98, the question is if it had been allowed sometime before the standardization, but I think it never did) allow this, so you always had to do

    foo *bar = (foo *)malloc(sizeof *bar);
Therefore, C is not a subset of C++. But a (non-empty ;) intersection of C and C++ exists.