Which C Features are influenced by/derived from C++ Features?

I cannot confirm that they were definitely influenced by C++ directly1, but here is a list of features in standard C++ that were added in C99:

  • single line comments (as mentioned)
  • inline functions
  • variables allowed after beginning of block
  • boolean datatype
  • complex math library

C11:

  • Anonymous unions (C11 allows anonymous structs too). Anonymous unions were already in standard C++. (Anonymous structs are still not allowed in standard C++).

1 For example BCPL, predecessor of B which in turn is the predecessor of C already had same syntax for single line comments. Some of these may have been supported as language extensions in some C implementation prior to their incorporation to standard C++. In these cases both standard C and standard C++ may have been influenced by the same source, rather than influencing one another.


Attributes were added in C++11 and will be added in the next C standard revision C2x. The proposal (and here) for this feature specifically references C++.

Attributes can be useful for providing information that, for example, helps the compiler to issue better diagnostics or optimize the generated code. Source

Example:

int [[attr1]] i [[attr2, attr3]];

[[attr4(arg1, arg2)]] if (cond)

{
    [[vendor::attr5]] return i;
}

In this example, "attribute attr1 applies to the type of variable i, attr2 and attr3 apply to the variable itself, attr4 applies to the if statement and vendor::attr5 applies to the return statement." Source