- Remove Trigraphs.
- Remove K&R function definitions/declarations (with no information about the function arguments)
- Remove Trigraphs.
- Remove K&R function definitions/declarations (with no information about the function arguments)
Not used C for many years, but used it a lot earlier.
And had read both the first and second editions of the k&r c book (ed. 1 pre-ansi, ed. 2 ansi).
based on that, iirc, this:
>Remove K&R function definitions / declarations
should actually be:
function definitions / declarations as in the first edition of the k&R C book.
In my previous comment, I was going to say (from memory), that in the second edition, i.e. in ANSI C, both types of declarations are allowed, old style and new style.
Also, if you just wrote the declaration (return value, then function name followed by types with arguments in parentheses), followed by a semicolon, without a function body in braces, it was called a function prototype.
MS C (as in, some version of Visual Studio's command line C compiler), had a flag to generate the prototypes from the function definitions. I had used it some. /Zg, possibly.
name (argument list, if any)
argument declarations, if any
{
declarations
statements
}
Is this disallowed in C23?This is horrible, I loved using `and` and `not` and `or` in C boolean expressions and to pretend I'm writing Python code. It's fun!
In C, "trigraph" specifically refers to nine special sequences beginning with "??": https://en.wikipedia.org/wiki/Digraphs_and_trigraphs#C
They were used to provide an alternate way of typing punctuation characters for keyboards that don't have them (e.g. "??(" is "[").
#define and &&
#define not !
/* ... and so on */
In C++, they're actually keywords that are built into the language, so you don't need a header then.When people talk about trigraphs in C, they're talking about the trigraphs listed on this page: https://en.cppreference.com/w/c/language/operator_alternativ...