Jump to content

C: Difference between revisions

From EDM2
No edit summary
Ak120 (talk | contribs)
 
(30 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[Image:The_C_Programming_Language.png|right|160px]]
[[Image:The_C_Programming_Language.png|right|160px]]
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]].
The programming language '''C''' is a weakly typed imperative language in the [[CPL]] branch of the [[Algol]] family of programming languages. It's the one of the more popular programming language after [[Java]] and that alongside its widespread use as a systems language has meant that most C development systems available have seen a lot of maintenance and are therefore in a relatively good standing when it comes to support for modern CPU architectures and systems vis a vis some other languages.


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.
==History==
A direct descendant of [[BCPL]] although it uses a very different syntax.
Later developments are [[C++]], [[Objective C]] and D.
 
===Standards===
Early versions do not follow any standard apart from the ''C Reference Manual'' that was included with the UNIX System release. There were lots of early C versions 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.
 
The ANSI X3.159-1989 standard ([[ANSI C]]) was ratified in 1989 that was adopted by ISO one year later.


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.
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.


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.
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.


==A list of OS/2 implementations of C==
==Features==
<div style="column-count:2;-moz-column-count:2;-webkit-column-count:2">
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.
* [[Borland C/C++]] - Commercial - Discontinued
* [[Cabot UCSD Pascal]] - Commercial - Discontinued
* [[Cint]] - Open source - Current - [https://root.cern.ch/drupal/content/cint Interpreter from CERN], intended for educational use
* [[EMX Compiler]] - Open Source - Discontinued
* [[GCC C CPP Compiler and Linker|GCC C/C++ Compiler and Linker]] - Open Source - Current
* [[Innotek GCC]] - Open Source - Discontinued
* [[IBM C/2]] - Commercial for 16 bit OS/2 only - Discontinued
* [[IBM C Set/2]] - Commercial - Discontinued
* [[IBM C Set++ for OS/2]] - Commercial - Discontinued
* [[VisualAge C++|IBM VisualAge C++]] - Commercial - Discontinued
* [[Lattice C]] - Commercial - Discontinued
* [[Metaware High C/C++]] - Commercial - Discontinued
* [[Microsoft C]] - Commercial - Discontinued.
* [[NDP C]] - Commercial - Discontinued
* [[Open Watcom|OpenWatcom C/C++]] - Open Source - Current
* [[TopSpeed C]] - Commercial - Discontinued
* [[VZ Programmer]] - Commercial - Discontinued
* [[Zortech C++]] - Commercial - Discontinued
</div>
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.


===C libraries===
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, 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.
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++|C++ page]] for available C++ libraries.


====Graphics and UI libraries====
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 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 PCs and [[UNIX]] systems, especially if they have registered I/O and file systems. Those systems rely to a much higher degree on throughput than processing power vis-a-vis PCs and workstations, so languages like [[FORTRAN]] and [[PL/I]] have tended to survive in those environments.
* [[Cairo]] - 2D graphics library - Open source - Current
* [[C-scape Interface Management System]] - Screen painter and UI library - Commercial - Discontinued.
* [[Greenleaf Data Windows]] - Text mode windows & UI - Commercial - Discontinued
* IBM [[SAA Common User Access Controls Library/2]] - Commercial - Discontinued
* [[Jpeglib]] - Read/write [[JPEG]] graphic files - Open source - Current.
* [[Libpng]] - Read/write [[PNG]] graphic files - Open source - Current
* [[nCurses]] - Text UI library - Open Source - Current
* [[Neuron Data Open Interface]] - Screen painter/UI toolkit - Commercial - Discontinued.
* [[Panel Plus II]] - Screen painter and UI library - Commercial - Current.
* [[Pixman]] - Low level graphics library - Open source - Current
* [[Public Domain Curses]] - Text UI library - Open Source - Current.
* [[SVGA-Kit and VESA-EMX]] - Graphic libraries - Open source - Discontinued.
* [[Simple Directmedia Layer]] - Multimedia - Open Source - Current.
* [[WebM libvpx]] - VP8/VP9 streaming video - Open Source - Current
* [[XVT]] - Screen painter and UI library - Commercial - Discontinued


====Database libraries====
==Implementations==
* [[C/Database Toolchest]] - Database creation and maintenance - Commercial - Current
===OS/2 1.x===
* [[dbfLIB]] - [[xBase]] database lib. - Commercial - Discontinued
Hosted language implementations that produce OS/2 16-bit object code
* [[e_Db]] - Database engine - Commercial - Discontinued
* [[IBM C/2]]
* [[Lattice dBC III]] - [[xBase]] database lib. - Commercial - Discontinued.
* [[Lattice C]]
* [[libdbf]] - reads dbf files - Open source - Discontinued.
* [[Microsoft C]]
* [[TopSpeed C]]
* [[Watcom C]]
* [[Zortech C++]]


====Other libraries====
===OS/2 2.x===
Hosted Language implementations that produce OS/2 32-bit object code
<div style="column-count:2;-moz-column-count:2;-webkit-column-count:2">
<div style="column-count:2;-moz-column-count:2;-webkit-column-count:2">
* [[Andy's Dynamic Link Library]] - Cross platform DLL's - Open source - Current
* [[Borland C++]] (1993-1996)
* [[cstring]] - String manipulation - Open source - Current
* FSF GNU Compiler Collection (GCC) (Open Source)
* [[CUtil]] - Common OS/2 functions - Open source - Current
** GCC/2
* [[Eco Common Lisp]] - Embedded scripting language - Open source - Discontinued
** [[emx]] GCC
* [[e_Comm]] - Communications and networking - Commercial - Discontinued
** [[Innotek GCC]]
* [[e_Fs]] - Virtual file system - Commercial - Discontinued
* [[IBM C Set/2]]
* [[FFTW]] - Fast Fourier Transforms - Open Source - Current
* [[IBM C Set++ for OS/2]]
* [[Lattice Comm Library]] - ANSI C communication library - Commercial - Discontinued.
* IBM [[VisualAge C++|IBM VisualAge C++]]
* [[LC-Port]] - [[Lattice C]] porting lib. - Commercial - Discontinued.
* [[Metaware High C/C++]] - also used for OS/2 PowerPC ELF
* [[libcURL]] Internet comms lib. - Open Source - Current
* Microway NDP C
* [[Libxml2]] - [[XML]] parser - Open source - Current
* [[Open Watcom|OpenWatcom C/C++]] (Open Source)
* [[Libxslt]] - [[XSLT]] parser - Open source - Current
* Symantec [[Zortech C++]] (1992-1993)
* [[LZO]] - Compression lib. - Open Source - Current.
* Watcom C/386
* [[LZ4]] - Compression lib. - Open Source - Current.
* [[OpenSSL]] - SSL & encryption - Open Source - Current
* [[POSIX Pthreads]] - BSD Pthreads library - Open Source - Discontinued.
* [[Public Domain Project C Library]] - Alternative CLIB - Open Source - Current.
* [[shwild]]  - Wildcard pattern matching - Open Source - Current.
* [[S-Lang]] - Embeddable macro/script lang. - Open Source - Current.
* [[Snappy]] - Compression lib. - Open Source - Current.
* [[The Standard Function Library]]  - Generic library - Open Source - Discontinued.
</div>
</div>
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.
===Interpreter===
*Cint - [https://root.cern.ch/drupal/content/cint Interpreter from CERN], intended for educational use


====Foreign libraries with C bindings====
See also: [[DOS Implementations of C]]
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====
==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.
Small programs or routines that you can integrate into your own programs or study to learn from, but are not delivered in library form.
* [[PDCRC]] - CRC routines in C - Open source
;Open source
* [[OS/2 Primecuts]] - OS/2 API Examples - Open source
* [[PDCRC]] - CRC routines in C
* [[OZPD]] - Sundry C routines and programs - Open Source - Current.
* [[OS/2 Primecuts]] - OS/2 API Examples
* [[Small examples of Workplace Shell programming]] - Open source - Discontinued.
* [[OZPD]] - Sundry C routines and programs
* [[Small examples of Workplace Shell programming]]


====GUI and application generators with C output====
==GUI and application generators with C output==
* [[General Application Workbench]] - GUI, animation, help and SQL - Commercial - Discontinued
;Commercial
* [[Hockware VisPro/C]] - GUI Creator - Commercial - Discontinued
*[[General Application Workbench]] - GUI, animation, help and SQL
* [[Panel Plus II]] - Screen painter and UI library - Commercial - Current.
*[[Hockware VisPro/C]] - GUI Creator
* [[PCYACC/2]] - CASE too with C output, targeted towards generating parsers etc. - Commercial - Discontinued
*Intersolv GA Workbench
* [[Vestronix Pro C]] - Database and spreadsheet application generator - Commercial - Discontinued
*[[Panel Plus II]] - Screen painter and UI library
*PCYACC/2 - CASE too with C output, targeted towards generating parsers etc.
*Vestronix Pro C - Database and spreadsheet application generator


====Translators that generate C output====
==Translators that generate C output==
* [[The APL c compiler project]] - Open source - Current.
* [[The APL c compiler project]]
* [[flex]] - Scanner generator - Open source - Discontinued.
* [[flex]] - Scanner generator - Open source
* [[M2CC/C]] [[Modula-2]] > C - Commercial - Discontinued.
* [[M2CC/C]] [[Modula-2]] > C - Commercial
* [[Oracle Pro*C]] - SQL > C - Commercial - Discontinued
* [[Oracle Pro*C]] - SQL > C - Commercial
* [[X2C]] - [[xBase]] to C compiler - Open Source - Current
* [[X2C]] - [[xBase]] to C compiler


====Code verifiers, beautifiers, visualisers and other C source code utilities====
==C Source Code Utilities==
* [[CC-Rider C++]] - Commercial - Discontinued - Static analyser, beautifier and visualiser.
* [[CC-Rider C++]] - Commercial - Static analyser, beautifier and visualiser.
* [[DOC++]] - Automatic document generator - Open source - Discontinued.
* [[DOC++]] - Automatic document generator - Open source
* [[Ephedra]] - C/C++ to Java - Open source - Discontinued
* [[Ephedra]] - C/C++ to Java - Open source
* [[Exuberant ctags]] - Creates index files out of C source files - Open source - Current.
* [[Exuberant ctags]] - Creates index files out of C source files
* [[PC-Lint]] - Commercial - Discontinued - Static analyser.
* [[SourceLink]] - Commercial - Browser/Editor/Visualiser
* [[SourceLink]] - Commercial - Discontinued - Browser/Editor/Visualiser.
* [[Source Mapper]] - Open source - Visualiser
* [[Source Mapper]] - Open source - Discontinued - Visualiser.
* [[Splint]] - Open source - Current - Static analyser.


====OS/2 text & programmers editors with C support====
;Static analyser
* [[Boxer]] - C support included by default - Commercial - Discontinued
* PC-Lint
* [[BRIEF]] - C support included by default - Commercial - Discontinued
* [[Splint]]
* [[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====
====Applications with a C programming interface====
Line 135: Line 99:
====C like scripting languages====
====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.
Note that this does not include full interpreters like [[Cint]], but either languages squarely intended to be scripted and/or embeddable interpreters.
* [[CEnvi]] - Shareware - Discontinued - Predecessor to ScriptEase (below).
* [[CEnvi]] - Shareware - Predecessor to ScriptEase (below).
* [[C Scripting Language]] - Open source - Current
* [[C Scripting Language]]
* [[C Styled Script]] - Open source - Discontinued
* [[C Styled Script]] - Open source
* [[ScriptEase]] - Commercial - Discontinued
* [[ScriptEase]] - Commercial
 
==A list of DOS implementations of C==
====Compilers====
<div style="column-count:2;-moz-column-count:2;-webkit-column-count:2">
* [[Aztec C86]] by Manx Software Systems - Commercial - Discontinued - [http://www.aztecmuseum.ca/compilers.htm#msdos Ancient World of Aztec C]
* Borland [[Turbo C]] - Commercial - Discontinued - Some versions [http://edn.embarcadero.com/article/20841 now freeware]
* [[C386]] - Open source - Current
* [[C86]] by Computer Innovations - Commercial - Discontinued - [http://www.clipshop.ca/c86/ C86]
* C/86 - Simple single pass C compiler from [[Norell Data Systems]] - Discontinued
* [http://www.desmet-c.com Desmet C] - Was commercial - now open source
* Dev86dos - Open source - Current - Kludgy
* [http://chiclassiccomp.org/docs/content/computing/Ecosoft/Ecosoft_Brochure.pdf ECO-C88] - Commercial - Discontinued
* [[EMX Compiler]] - Open Source - Discontinued
* [[IBM PC C Compiler]] - Commercial - 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
* [http://www.lsi-j.co.jp/products/lsic86.html LSI-C] - Freeware - Current - Cross compilation from Windows or Unices only - English [http://homepage3.nifty.com/mmgames/c_guide/en/p_lsic86.html 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
* [[Open Watcom|OpenWatcom C/C++]] - Open Source - Current
* [http://www.grifo.com/SOFT/Pacific/uk_pacific.html 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
* [https://github.com/jossk/c--sphinx Sphinx C--] - Minimalistic C - Open source - Discontinued
* [[SuperC]] - Commercial - Discontinued
* [http://bellard.org/tcc/ TCC] - Open source - Discontinued - Cross compilation from Windows or Linux only.
* [[TopSpeed C]] - Commercial - Discontinued
* [[Wizard C]] - Commercial - Discontinued
* [[Zortech C++]] - Commercial - Discontinued
</div>
 
====Interpreters====
* [[Cint]] - Open source - Current - [https://root.cern.ch/drupal/content/cint Interpreter from CERN], intended for educational use
* Rational Instant-C
* Lifeboat Associates Run/C
 
====DOS libraries====
* [[C/Database Toolchest]] - Library for database creation and maintenance - Commercial - Current
* [[e_Db]] - Database engine - Commercial - Discontinued.
* [[Greenleaf Data Communications]] - Commercial - Discontinued.
* [[Greenleaf Data Windows]] - Text mode windows & UI - Commercial - Discontinued.
* [[The Greenleaf functions]] - Commercial - Discontinued.
* [[libdbf]] - reads dbf files - Open source - Discontinued.
* [[Public Domain Curses]] - Text UI library - Open Source - Current.
* [[Public Domain Project C Library]] - Alternative CLIB - Open Source - Current.
* [[The Standard Function Library]]  - Generic library - Open Source - Discontinued.
* [[Vitamin C]]  - Multi-platform UI library - Commercial - Discontinued.
 
====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.
* [[Open Watcom|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==
==Publications==
* Nabajyoti Barkakati: [http://www.tenox.net/docs/misc/Microsoft_C_Bible.pdf Microsoft C Bible] - 1988 - Applies to [[Microsoft C]] 5.1, but also contains some other useful info.
* [http://jclt.iecc.com The Journal of C Language Translation] - Magazine on advanced C topics, published from 1989 to 1993, freely downloadable in a [[PDF]] format.
* [http://jclt.iecc.com The Journal of C Language Translation] - Magazine on advanced C topics, published from 1989 to 1993, freely downloadable in a [[PDF]] format.
* [[Anthony S. Rudd]]: ''C. for Non-C Programmers'' - 1993 - John Wiley & Sons - ISBN 089435468X - Out of print
*[[Anthony S. Rudd]]: ''C. for Non-C Programmers'' - 1993 - John Wiley & Sons - ISBN 089435468X
* [[Anthony S. Rudd]]: ''Mastering C'' - 1994 - Wiley/QED - Paperback, 371 pages - ISBN 0471608203 -  ISBN 978-0471608202 - Out of print
*Anthony S. Rudd: ''Mastering C'' - 1994 - Wiley/QED, ISBN 0-471-60820-3
* [[Kris Jamsa]]: ''Jamsa's C/C++/C# Programmer's Bible: 2nd edition'' - 17 January, 2002 - Delmar Cengage Learning - Paperback,  1199 pages + CD-ROM - ISBN 0766846822 - ISBN 978-0766846821 - Out of Print
*Kris Jamsa: ''The Quick Reference Guide to C. Run-time Library'' - Microsoft Press 1989, ISBN 1-55615-227-2
* [[Kris Jamsa]]: ''The Quick Reference Guide to C. Run-time Library'' - August 1989  - Microsoft Press - Paperback, 208 pages - ISBN 1556152272 - ISBN 978-1556152276 - Out of print
*Kris Jamsa: ''The C Library'' - Osborne/McGraw-Hill 1985, ISBN 0-07-881110-4
* [[Kris Jamsa]]: ''The C Library'' - 1 September, 1985 - Osborne/McGraw-Hill - Paperback, 220 pages - ISBN 0078811104 - ISBN 978-0078811104 - Out of print.
:Not as you might think a discussion of the [[Microsoft C]] library, but rather a collection of C routines and utilities written in [[C]], most of them [[UNIX]] derived or inspired and a couple of them uncommon.
:Not as you might think a discussion of the [[Microsoft C]] library, but rather a collection of C routines and utilities written in [[C]], most of them [[UNIX]] derived or inspired and a couple of them uncommon.
====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====
==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]]:
* EDM/2 has its own C tutorial, it's called simply '''Introduction to C Programming''', and was written by [[Carsten Whimster]]:
{| width="400" cellpadding="4"
*:Part [[Introduction to C Programming - Part 1|1]], [[Introduction to C Programming - Part 2|2]], [[Introduction to C Programming - Part 3|3]], [[Introduction to C Programming - Part 4|4]], [[Introduction to C Programming - Part 5|5]], [[Introduction to C Programming - Part 6|6]], [[Introduction to C Programming - Part 7|7]], [[Introduction to C Programming - Part 8|8]], [[Introduction to C Programming - Part 9|9]], [[Introduction to C Programming - Part 10|10]]
| align="CENTER" valign="MIDDLE" |
[[Introduction to C Programming - Part 1|Part 1]]
| align="CENTER" valign="MIDDLE" |
[[Introduction to C Programming - Part 2|Part 2]]
| align="CENTER" valign="MIDDLE" |
[[Introduction to C Programming - Part 3|Part 3]]
| align="CENTER" valign="MIDDLE" |
[[Introduction to C Programming - Part 4|Part 4]]
| align="CENTER" valign="MIDDLE" |
[[Introduction to C Programming - Part 5|Part 5]]
| align="CENTER" valign="MIDDLE" |
[[Introduction to C Programming - Part 6|Part 6]]
| align="CENTER" valign="MIDDLE" |
[[Introduction to C Programming - Part 7|Part 7]]
| align="CENTER" valign="MIDDLE" |
[[Introduction to C Programming - Part 8|Part 8]]
| align="CENTER" valign="MIDDLE" |
[[Introduction to C Programming - Part 9|Part 9]]
| align="CENTER" valign="MIDDLE" |
[[Introduction to C Programming - Part 10|Part 10]]
|}
* Aalto University and the University of Helsinki have a free course in C called [http://mooc.fi/courses/2016/aalto-c/en/ Aalto-C]
* [[MIX Software]] has a number of video courses available that focus on teaching C, these are focused primarily towards the [http://www.mixsoftware.com/product/cvideo.htm beginner], note that these are delivered in proper old school [[VHS]] cassette format.


==Links==
==Links==
====USENET====
* [news:comp.lang.c.moderated comp.lang.c.moderated] - Moderated C discussion group
* [news:comp.lang.c.moderated comp.lang.c.moderated] - Moderated C discussion group - Go to the [https://groups.google.com/forum/#!forum/comp.lang.c.moderated Google groups version] if your ISP does not offer USENET access or you are in any other way newsgroup challenged.
* [http://c-faq.com/ comp.lang.c Frequently Asked Questions] - FAQ compiled by Steve Summit


====Frequently Asked Question lists (FAQ's)====
* Aalto University and the University of Helsinki have a free course in C called [http://mooc.fi/courses/2016/aalto-c/en/ Aalto-C]
* [http://c-faq.com/ comp.lang.c Frequently Asked Questions] - Compiled by Steve Summit.
* [[MIX Software]] has a number of video courses available that focus on teaching C, these are focused primarily towards the [http://www.mixsoftware.com/product/cvideo.htm beginner], note that these are delivered in VHS cassette format.
 
==Standards==
* Early versions do not follow any standard apart from the [http://www.fh-jena.de/~kleine/history/languages/Ritchie-CReferenceManual.pdf 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==


[[Category:Programming Languages]] [[Category:C]]
[[Category:Programming Languages]] [[Category:C]]

Latest revision as of 19:40, 23 October 2021

The programming language C is a weakly typed imperative language in the CPL branch of the Algol family of programming languages. It's the one of the more popular programming language after Java and that alongside its widespread use as a systems language has meant that most C development systems available have seen a lot of maintenance and are therefore in a relatively good standing when it comes to support for modern CPU architectures and systems vis a vis some other languages.

History

A direct descendant of BCPL although it uses a very different syntax. Later developments are C++, Objective C and D.

Standards

Early versions do not follow any standard apart from the C Reference Manual that was included with the UNIX System release. There were lots of early C versions 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.

The ANSI X3.159-1989 standard (ANSI C) was ratified in 1989 that was adopted by ISO one year later.

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.

Features

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, 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 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 PCs and UNIX systems, especially if they have registered I/O and file systems. Those systems rely to a much higher degree on throughput than processing power vis-a-vis PCs and workstations, so languages like FORTRAN and PL/I have tended to survive in those environments.

Implementations

OS/2 1.x

Hosted language implementations that produce OS/2 16-bit object code

OS/2 2.x

Hosted Language implementations that produce OS/2 32-bit object code

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.

Interpreter

See also: DOS Implementations of C

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.

Open source

GUI and application generators with C output

Commercial
  • General Application Workbench - GUI, animation, help and SQL
  • Hockware VisPro/C - GUI Creator
  • Intersolv GA Workbench
  • Panel Plus II - Screen painter and UI library
  • PCYACC/2 - CASE too with C output, targeted towards generating parsers etc.
  • Vestronix Pro C - Database and spreadsheet application generator

Translators that generate C output

C Source Code Utilities

  • CC-Rider C++ - Commercial - Static analyser, beautifier and visualiser.
  • DOC++ - Automatic document generator - Open source
  • Ephedra - C/C++ to Java - Open source
  • Exuberant ctags - Creates index files out of C source files
  • SourceLink - Commercial - Browser/Editor/Visualiser
  • Source Mapper - Open source - Visualiser
Static analyser

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.

Publications

  • The Journal of C Language Translation - Magazine on advanced C topics, published from 1989 to 1993, freely downloadable in a PDF format.
  • Anthony S. Rudd: C. for Non-C Programmers - 1993 - John Wiley & Sons - ISBN 089435468X
  • Anthony S. Rudd: Mastering C - 1994 - Wiley/QED, ISBN 0-471-60820-3
  • Kris Jamsa: The Quick Reference Guide to C. Run-time Library - Microsoft Press 1989, ISBN 1-55615-227-2
  • Kris Jamsa: The C Library - Osborne/McGraw-Hill 1985, ISBN 0-07-881110-4
Not as you might think a discussion of the Microsoft C library, but rather a collection of C routines and utilities written in C, most of them UNIX derived or inspired and a couple of them uncommon.

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, 2, 3, 4, 5, 6, 7, 8, 9, 10

Links

  • 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 VHS cassette format.