Skip to study material
← Question index

QUESTION 37 · C fundamentals

Who developed C? State two characteristics of the language.

2 marks

Answer

Dennis Ritchie developed C at Bell Labs in the early 1970s.

  • C supports structured program organisation through functions and blocks.
  • It provides typed arithmetic, pointers and bit operations for general-purpose and systems programming.

QUESTION 38 · C fundamentals

Describe the background and important characteristics of C.

5 marks

Answer in brief

C is a general-purpose programming language developed by Dennis Ritchie at Bell Labs in the early 1970s.

Background

C developed alongside the Unix operating system. It provided readable programming statements while also allowing work with memory addresses and bits. These features made it useful for system programs as well as general applications.

Main characteristics of C

  1. Structured programming: A solution can be divided into functions and blocks. This makes a large program easier to organise.
  2. Typed variables: Variables have types such as int, char and double. A type describes the values and operations that can be used.
  3. Operators: C provides arithmetic, comparison, logical and bitwise operators.
  4. Pointers: A pointer stores an address. Pointers allow programs to work with other objects through their locations.
  5. Standard library: Headers such as stdio.h provide declarations for useful functions, including input and output functions.
  6. Portability: Source code can often be used on different systems when it follows standard rules and uses suitable libraries.

Applications

C is used in operating systems, embedded systems, compilers and libraries. The language gives the programmer control, but that also means the programmer must check input, array limits, memory use and numeric ranges. Writing a program in C does not automatically make its algorithm efficient.

Important distinction

C is the language; GCC and Clang are implementations that can compile C. The same source may produce different executable files for different systems. Sizes of types can also differ between implementations. These notes use C11-compatible examples for a hosted environment, where standard startup and input/output facilities are available.

Key points

  • C source portability depends on the facilities and assumptions used.
  • Standard library functions need the appropriate declarations.