Advertisements
Charecteristics of C:
Like most imperative languages in the ALGOL tradition, C has facilities for structured programming and allows lexical variable scope and recursion, while a static type system prevents many unintended operations. In C, all executable code is contained within functions. Function parameters are always passed by value. Pass-by-reference is simulated in C by explicitly passing pointer values. Heterogeneous aggregate data types (struct) allow related data elements to be combined and manipulated as a unit. C program source text is free-format, using the semicolon as a statement terminator (not a delimiter).
C also exhibits the following more specific characteristics:
1. lack of nested function definitions
2. variables may be hidden in nested blocks
3. partially weak typing; for instance, characters can be used as integers
4. low-level access to computer memory by converting machine addresses to typed pointers
5. function and data pointers supporting ad hoc run-time polymorphism
6. array indexing as a secondary notion, defined in terms of pointer arithmetic
7. a preprocessor for macro definition, source code file inclusion, and conditional compilation
8. complex functionality such as I/O, string manipulation, and mathematical functions consistently delegated to library routines
9. A relatively small set of reserved keywords
10. A lexical structure that resembles B more than ALGOL, for example:
o { ... } rather than either of ALGOL 60's begin ... end or ALGOL 68's ( ... )
o the equal-sign is for assignment (copying), more like Fortran, than like ALGOL's ":=" assignment.
o two consecutive equal-signs are to test for equality (compare to .EQ. in Fortran or the equal-sign in BASIC and ALGOL)
o && and || in place of ALGOL's "∧" (AND) and "∨" (OR) (these are semantically distinct from the bit-wise operators & and | because they will never evaluate the right operand if the result can be determined from the left alone (short-circuit evaluation)).
+ However Unix Version 6 & 7 versions of C indeed did use ALGOL's / and / ASCII operators, but for determining Infimum and Supremum respectively.[1]
o a large number of compound operators, such as +=, ++, etc. (Equivalent to ALGOL 68's +:= and +:=1 operators)