• Skull giver@popplesburger.hilciferous.nl
    link
    fedilink
    arrow-up
    0
    ·
    10 months ago

    The real fun about treating C++ as a superset of C begins when you run into cases where the languages differ.

    I’m not talking about classes and templates and stuff like that either, I’m talking about relatively simple syntax that people expect to be present in both languages.

    if (1) int a = 42;
    

    is valid C++, but will not valid C. That’s because the definition of a what a statement is differs between the two and has since the 80s!