Jump to content

C

From EDM2

A weakly typed imperative language in the CPL branch of the Algol family of programming languages, the predecessor to C++ and a direct descendant of BCPL although it uses a very different syntax. Currently the world's second most popular programming language after Java.

C is often erroneously described as being "closer to the hardware" than other languages, and this is used to explain why it is faster and less portable than "language x". In fact C is no closer or further from the metal than any other similar language in the Algol branch, no more or less portable and no faster or slower either. What C is however is a systems language much like PL/I, i.e. it is designed from the outset to be able to program any function that a computer system requires and therefore provides a number of low level functions that are designed to aid in systems programming but are not necessarily useful in day to day programming.

This is in contrast to a number of other languages like Pascal that are domain specific or in other words are designed to perform well inside a specific functionality domain. This includes application, simulation, scripting or teaching languages et cetera, and these are not or were not originally meant to be used to write systems software with although you can coax them to do so in many cases or extend them to encapsulate functions needed for systems software.

But even though C was designed from the outset as a systems language it does have some peculiar deficiencies that have never been fixed altogether, it is much slower than most other Algol family languages in doing I/O, to a point where even interpreted versions of Pascal and Basic can be considerably faster performing I/O than compiled C code. For this reason C has never really caught on as a programming language on mainframes and most minicomputer systems to the degree it has on PC's and UNIX systems, especially if the servers have registered I/O and file systems. Those systems rely to a much higher degree on throughput than processing power vis-a-vis PC's and workstations, so languages like FORTRAN, APL and PL/I have tended to survive in those environments.

A list of OS/2 implementations of C

There was also a port of Comeau C++ 3.x that was functional but never released as a product, although a few examples got released into the wild.

Libraries

If the compiler you use supports both C and C++, you can use C libraries with your C++ programs and vise versa, however using C++ libraries from C can be a bit kludgey and can require you to write bindings, while using C libraries with C++ is less problematic it can also require you to write some interfaces, take a look at the C++ page for available C++ libraries.

Foreign libraries with C bindings

Libraries written in other programming languages that have bindings that allow them to be called as a library from a C program. This does not include DLL's or WPS code.

  • Snappy - Compression lib. - Open Source - Current.

C source code snippets, archives and collections

Small programs or routines that you can integrate into your own programs or study to learn from, but are not delivered in library form.

GUI and application generators with C output

  • General Application Workbench - GUI, animation, help and SQL - Commercial - Discontinued
  • Hockware VisPro/C - GUI Creator - Commercial - Discontinued
  • PCYACC/2 - CASE too with C output, targeted towards generating parsers etc. - Commercial - Discontinued
  • Vestronix Pro C - Database and spreadsheet application generator - Commercial - Discontinued

Translators that generate C output

Code verifiers, beautifiers, visualisers and other C source code utilities

  • CC-Rider C++ - Commercial - Discontinued - Static analyser, beautifier and visualiser.
  • Ephedra - C/C++ to Java - Open source - Discontinued
  • Exuberant ctags - Creates index files out of C source files - Open source - Current.
  • PC-Lint - Commercial - Discontinued - Static analyser.
  • SourceLink - Commercial - Discontinued - Browser/Editor/Visualiser.
  • Source Mapper - Open source - Discontinued - Visualiser.
  • Splint - Open source - Current - Static analyser.

OS/2 text & programmers editors with C support

  • Boxer - C support included by default - Commercial - Discontinued
  • BRIEF - C support included by default - Commercial - Discontinued
  • Elvis - C syntax support included by default - Open source - Current
  • Enhanced Editor - Has syntax highlighting, auto-formatting and automatic code summary for C.
  • FTE - Has support for syntax highlighting, code folding and syntax-aware autoindent.
  • jEdit - Java based - Open source - Current
  • Lugaru Epsilon - C syntax highlighting, code folding and syntax-aware autoindent. - Commercial
  • NEdit - XFree86 - Autoindent, autocomplete and syntax highlighting.
  • Preditor/2 - C template with syntax highlighting - Commercial - Discontinued.
  • SourceLink - Commercial - Discontinued - Browser/Editor/Visualiser.

Applications with a C programming interface

C like scripting languages

Note that this does not include full interpreters like Cint, but either languages squarely intended to be scripted and/or embeddable interpreters.

A list of DOS implementations of C

Compilers

  • Aztec C86 by Manx Software Systems - Commercial - Discontinued - Ancient World of Aztec C
  • Borland Turbo C - Commercial - Discontinued - Some versions now freeware
  • C386 - Open source - Current
  • C86 by Computer Innovations - Commercial - Discontinued - C86
  • C/86 - Simple single pass C compiler from Norell Data Systems - Discontinued
  • Desmet C - Was commercial - now open source
  • Dev86dos - Open source - Current - Kludgy
  • ECO-C88 - Commercial - Discontinued
  • EMX Compiler - Open Source - Discontinued
  • Intel C Code Builder - Commercial - Discontinued
  • LADSoft CC386 - Open source - Discontinued
  • Lattice C - Commercial - Discontinued
  • Let's C - Commercial - Discontinued - Primarily intended for educational purposes
  • LSI-C - Freeware - Current - Cross compilation from Windows or Unices only - English here
  • Mark Williams C - Commercial - Discontinued
  • Metaware High C/C++ - Commercial - Discontinued
  • Microsoft C - Commercial - Discontinued
  • Microsoft QuickC - Commercial - Discontinued
  • MIX C - Commercial - Discontinued
  • NDP C - Commercial - Discontinued
  • OpenWatcom C/C++ - Open Source - Current
  • Pacific C - Commercial - Discontinued - Was shareware is now freeware
  • Portable C - Open source - DOS and cross compilation for 68000 and AMD RISC processors.
  • Power C - Commercial - Current
  • Sphinx C-- - Minimalistic C - Open source - Discontinued
  • SuperC - Commercial - Discontinued
  • TCC - Open source - Discontinued - Cross compilation from Windows or Linux only.
  • TopSpeed C - Commercial - Discontinued
  • Wizard C - Commercial - Discontinued
  • Zortech C++ - Commercial - Discontinued

Interpreters

  • Cint - Open source - Current - Interpreter from CERN, intended for educational use
  • Rational Instant-C
  • Lifeboat Associates Run/C

DOS libraries

DOS C database bindings

  • Empress - Commercial - Discontinued

DOS text & programmers editors with C support

  • Boxer - C support included by default - Commercial - Discontinued
  • BRIEF - Commercial - Discontinued
  • Elvis - C syntax support included by default - Open source - Current
  • FTE - Has support for syntax highlighting, code folding and syntax-aware autoindent.

A list of C implementations that run under WinOS/2

  • Microsoft C - Commercial - Discontinued - Cross compilation from DOS or OS/2 only.
  • OpenWatcom C/C++ - Open Source - Current
  • TopSpeed C - Commercial - Discontinued - Cross compilation from DOS or OS/2 only.

WinOS/2 compatible libraries

  • C/Database Toolchest - Library for database creation and maintenance - Commercial - Current - Note that the correct library for Win16b development is called the DOS library (but contains Win 16b libs as well) and not the Windows one.
  • e_Db - Database engine - Commercial - Discontinued.
  • libdbf - reads dbf files - Open source - Discontinued.
  • Public Domain Curses - Text UI library - Open Source - Current.

Publications

Local articles

  • Finn Overgaard Hansen: 12 Common C Errors - Outdated but still somewhat useful especially for beginners and intermediate users.

Tutorials and other learning material

  • EDM/2 has its own C tutorial, it's called simply Introduction to C Programming, and was written by Carsten Whimster:

Part 1

Part 2

Part 3

Part 4

Part 5

Part 6

Part 7

Part 8

Part 9

Part 10

  • Aalto University and the University of Helsinki have a free course in C called Aalto-C
  • MIX Software has a number of video courses available that focus on teaching C, these are focused primarily towards the beginner, note that these are delivered in proper old school VHS cassette format.

Links

USENET

Frequently Asked Question lists (FAQ's)

Standards

  • Early versions do not follow any standard apart from the C Reference Manual that was included with the UNIX system release and there were lots of C versions out there that were incompatible with each other, with every American university appearing to have its own minor variant for a while.
  • In 1978 Brian Kernighan and Dennis Ritchie published "The C Programming Language" book which became an informal standard, referred to as "K&R C", the only problem being that it is not 100% internally coherent.
  • ANSI committee X3J11 was formed in 1983 to standardise the language, compiler manufacturers started to talk about "ANSI C" almost immediately based upon drafts, but actually the ANSI X3.159-1989 standard was not ratified until 1989. This means that when working with old "ANSI C" compatible tools and code they may differ somewhat from the standard as they have been designed from working drafts rather than the finished standard.
  • The ANSI X3.159-1989 was ratified by ISO in 1990 with only minor changes and that is the reason that the basic C standard is sometimes known as either C89 or C90
  • The ISO/IEC JTC1/SC22/WG14 working group produced the ISO/IEC 9899:1999 which is known informally as "C99", note that there are three later additions/amendments to the standard and therefore not all C99 code is 100% compatible.
  • In 2011 the ISO/IEC 9899:2011 or "C11" standard was introduced, while there is some language changes, the main changes are in the standard libraries.

C history