this post was submitted on 02 Feb 2024
1021 points (98.3% liked)

Programmer Humor

32179 readers
293 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments

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!