Royal Holloway, University of London logo
  • Staff
  • Students
  • About us
    • Welcome
    • Our campus
    • Our history
    • Press Office
    • Governance
    • Online store
    • Facts & figures
    • Job vacancies
    • Choir of Royal Holloway
    • Contact us
  • Study here
    • Undergraduate
    • Postgraduate
    • Research degrees
    • Scholarships
    • Accommodation
    • Open days
    • Welcome Week
    • Prospectus
    • Guide for parents
    • Schools & colleges
    • Passport Award
    • Discover Arts
    • Discover Science
    • Lifelong learning
    • Careers
  • Departments
    & Schools
    • Biological Sciences
    • Classics
    • Comparative Literature & Culture
    • Computer Science
    • Criminology & Sociology
    • Drama & Theatre
    • Earth Sciences
    • Economics
    • English
    • European Studies
    • Geography
    • History
    • Information Security
    • Management
    • Mathematics
    • Media Arts
    • Modern Languages, Literatures & Cultures
    • Music
    • Philosophy
    • Physics
    • Politics & International Relations
    • Psychology
    • Social Work
  • Student life
    • Accommodation
    • Campus & facilities
    • Social life
    • Student media
    • Students' Union
    • Sports & activities
    • Support, health & welfare
    • Jobs while you study
    • Sustainability
    • Videos
  • International
    • Why Royal Holloway?
    • Applying
    • English language & university preparation
    • Study abroad & exchanges
    • Your country
    • Fees & scholarships
    • After applying
    • Support for international students
    • Information for partners
    • News
    • Virtual Open Day
    • Contact us
  • Research
    • Current research
    • Current research students
    • Research opportunities
    • Research support
    • Departments & Groups
    • REF2014
    • Pure support
    • News
    • Events
    • Commercialisation seed funds
    • Women in research
  • For business
    • Conferences & hospitality
    • Consultancy
    • Enterprise centre / incubation
    • Licensing / commercialisation
    • Research & business
    • Interns / graduate recruitment
    • CPD
  • Alumni
    • News
    • Events & reunions
    • Getting involved
    • Giving to the College
    • Benefits & services
    • Notable alumni
    • Our alumni
    • American Foundation
    • Staying in touch
    • Higher magazine
    • The Curiosity Project
    • Contact us

C


C is a small, Algol-family procedural language designed to support the implementation of the Unix operating system. Dennis Ritchie developed C in the early 1970's from a language called B (itself developed by Ken Thompson from BCPL).

The history of C is described by Ritchie in a paper from the HoPL II (History of Programming Languages II) conference which you can read here.

There are three major versions of C.

  1. [K&R C] The original language was developed between 1971 and 1973. This version is usually called K&R C after the authors of the definitive book on the language (Brian Kernighan and Dennis Ritchie) which was published in 1978.

  2. [C90] By the early 1980's, usage was widespread enough to merit formal standardisation. ANSI established the X3J11 committee in 1983, and the first standard X3.159-1989 was produced in 1989. The following year ISO ratified the standard as ISO/IEC 9899:1990. This version of the language is referred to variously as ANSI-C, C89 or C90 (our preferred name). An amendment was published in 1995 (Normative Amendment 1) which added support for international character sets. This amendment did not change the grammar, so we can ignore it here.

    We have two grammars available

    1. C90: second edition of K&R

      This is the grammar from Appendix A (pages 234--239) of KR2 ('The C Programming Language' second edition, Brian W. Kernighan and Dennis M. Ritchie; Prentice Hall; 1988 ISBN 0-13-110362).

      NB: The preprocessor is only approximately described in this grammar. In addition, there are errors in the preprocessor part of the grammar that we have corrected. See the comments in the .raw file for details.

      We recommend that the ansi_c_89 grammar (below) is used instead of this one.

      ansi_c_kr2.raw raw grammar from the typeset document
      ansi_c_kr2.gex grammar rules extracted using gramex V1.2

    2. C90: ANSI X3.159-1989

      This is the grammar from Annex B of the 1989 ANSI standard. It contains a full description of the preprocessor's syntax. We recommend that this grammar is used in preference to the K&R version (above).

      ansi_c_89.raw raw grammar from the typeset document
      ansi_c_89.gex grammar rules extracted using gramex V1.2 ll1.tbl lr0.tbl slr1.tbl lr1.tbl lalr1.tbl generated by gtb V2.6

  3. [C99] A major revision of the standard was published by ISO in 1999 as ISO 9899:1999, which subsequently became an ANSI standard in 2000. This revision is usually called C99. Take up of C99 has been slow, perhaps because it is incompatible with C++ whereas C90 is (almost) a subset of C++.

© Royal Holloway University of London Egham, Surrey, TW20 0EX

T: +44 (0)1784 434455
  • Contact
  • Location maps
  • Media enquiries
  • Vacancies
  • Careers Service
  • IT Services
  • Library
  • Social media
  • CampusAnywhere
  • Cookies
  • Site map
  • Terms & conditions