$ ./guess_the_languageProgramming Languages
Programming Languages · hard · #539

Which programming language is this?

struct point { int x, y; };

struct point *p = malloc(sizeof *p);
*p = (struct point){ .x = 3, .y = 4 };
printf("%d\n", p->x + p->y);

Answer: C

Assigning malloc to a typed pointer without a cast and the (struct point){ .x = 3 } compound literal are C99 and not valid C++.
Play Programming Languages ▸