I will not name these styles, but variants of languages ββ(or dialects).
An encoding style is a set of optional conventions that may not be followed. For example, some coding styles require that macro names be all capitals (but your code will be compiled if you do not follow this rule).
Your β2 nd β style is called Kernighan and Ritchie C. This is an old C, defined in the late 1970s (in the very first issue of the famous C book by Kernighan and Ritchie; subsequent editions meet later C standards). This is an outdated language.
Current compilers often follow the C99 ISO standard (published in 1999), which has been superseded by the new C11 (published in 2011).
GCC compilers accept the C99 standard with the program argument -std=c99
. I highly recommend compiling with gcc -Wall -std=c99
; Recent GCC compilers (e.g. 4.6 and 4.7) accept -std=c11
IIRC for the newer C11 standard.
Do not use the code today in the old dialect of Kernighan and Ritchie C: it is deprecated and less and less supported by compilers. IMHO C99 is a good standard if you are careful. And take advantage of some of its functions (in particular, the ability to mix declarations and expressions within a block, older C dialects needed to place all declarations at the beginning of the block.).
The standard progressed, in particular, because it added functions and more precisely wrt to current systems and practices (for example, multi-core processors)
source share