Difference between revisions of "C programming language"

From Computer History Wiki
Jump to: navigation, search
(New page: The C language..... == Dialects == There are two popular dialects, the original was K&R C, which spread with the original C compiler, and pcc, the portable C compiler. Later there wa...)
 
m (See also: add them all, and notate them)
 
(20 intermediate revisions by 3 users not shown)
Line 1: Line 1:
The C language.....
+
The '''C programming language''' was derived from an earlier language called [[B programming language|B]]. There was a short-lived intermediary language called NB, or New B.
 +
 
 +
A number of object-oriented languages have been influenced by C, including
 +
[[Objective-C]], [[C++]], [[D]], [[Vala]].
  
 
== Dialects ==
 
== Dialects ==
There are two popular dialects, the original was K&R C, which spread with the original C compiler, and [[pcc]], the portable C compiler.  Later there was a ANSI standard to the C language, and it's usually refered to as just ANSI C.
+
There are two popular dialects, the original was K&R C, which spread with the original C [[compiler]], and [[pcc]], the portable C compiler.  Later there was a ANSI standard to the C language, and it's usually refered to as just ANSI C.
 +
 
 +
The C language evolved continuously starting in 1972.  Some milestones:
 +
 
 +
* 1972 - Primeval C - no '''struct''', automatic variables can't be initialized.
 +
* 1973 - preprocessor added.
 +
* 1976? - [[Typesetter C]] - introduced '''long''', '''unsigned''', '''typedef''', '''union''', and changed '''=+''' etc to '''+='''.
 +
* 1978 - K&R C
 +
* 1989 - ANSI C
  
 
== hello world ==
 
== hello world ==
 +
Ancient
 +
<pre>
 +
char *hello "hello"; /* No = for initialization. */
 +
 +
main (argc, argv)
 +
int argc;              /* Parameter declarations as in K&R. */
 +
char **argv;
 +
{
 +
        char *world;    /* Auto variables can't be initialized. */
 +
        world = "world";
 +
        cprint ("%s %s\n", hello, world);      /* No stdio yet. */
 +
}
 +
</pre>
 +
 
K&R
 
K&R
 
<pre>
 
<pre>
 
#include <stdio.h>
 
#include <stdio.h>
int main(argc,*argv[])
+
main(argc,argv)
 
int argc;
 
int argc;
char *argv;
+
char **argv;
 
{
 
{
printf("Hello World\n");
+
        printf("Hello World\n");
return 0;
+
        exit (0);
 
}
 
}
  
 
</pre>
 
</pre>
  
Ansi C
+
ANSI C
 
<pre>
 
<pre>
 
#include <stdio.h>
 
#include <stdio.h>
 
int main(int argc, char *argv[])
 
int main(int argc, char *argv[])
 
{
 
{
printf("Hello World\n");
+
        printf("Hello World\n");
return 0;
+
        return 0;
 
}
 
}
 
</pre>
 
</pre>
  
C was superseded by the [[C++]] language.
+
==Compilers==
 +
 
 +
* [[Borland C]]
 +
* [[Watcom C]]
 +
 
 +
==See also==
 +
 
 +
* [[Programming in C - A Tutorial]] - wonderfully clear and concise
 +
* [[Old C Changes]] - some history of the development
 +
* [[C Changes]]
 +
* [[Typesetter C]] - one important stage
 +
* [[Standard I/O library]] - I/O is not formally part of the language
 +
* [[PDP-11 C stack operation]]
 +
 
 +
{{semi-stub}}
 +
 
 +
==External links==
 +
 
 +
* [https://archive.org/stream/bstj57-6-1991/bstj57-6-1991_djvu.txt The C Programming Language] - the [[BSTJ]] paper
 +
* [http://squoze.net/UNIX/bltj/06771914.pdf The Evolution of C - Past and Future]
 +
* [https://www.bell-labs.com/usr/dmr/www/ Dennis M. Ritchie] - see section "C and its immediate ancestors"
 +
** [https://www.bell-labs.com/usr/dmr/www/cman.pdf C Reference Manual] - the version from [[UNIX Sixth Edition|V6]]
 +
** [https://www.bell-labs.com/usr/dmr/www/chist.html The Development of the C Language] ([https://www.bell-labs.com/usr/dmr/www/chist.pdf PDF]) - Ritchie paper with details of the early evolution
 +
** [https://www.bell-labs.com/usr/dmr/www/primevalC.html Primeval C] - Ritchie notes on some C software archaeology
 +
** [https://www.bell-labs.com/usr/dmr/www/clcs.html The C Language Calling Sequence] - interesting note by DMR and SCJ
  
{{stub}}
+
[[Category: Languages]]
[[Category:Languages]]
+
[[Category: C Language]]

Latest revision as of 19:13, 5 August 2023

The C programming language was derived from an earlier language called B. There was a short-lived intermediary language called NB, or New B.

A number of object-oriented languages have been influenced by C, including Objective-C, C++, D, Vala.

Dialects

There are two popular dialects, the original was K&R C, which spread with the original C compiler, and pcc, the portable C compiler. Later there was a ANSI standard to the C language, and it's usually refered to as just ANSI C.

The C language evolved continuously starting in 1972. Some milestones:

  • 1972 - Primeval C - no struct, automatic variables can't be initialized.
  • 1973 - preprocessor added.
  • 1976? - Typesetter C - introduced long, unsigned, typedef, union, and changed =+ etc to +=.
  • 1978 - K&R C
  • 1989 - ANSI C

hello world

Ancient

char *hello "hello"; /* No = for initialization. */

main (argc, argv)
int argc;               /* Parameter declarations as in K&R. */
char **argv;
{
        char *world;    /* Auto variables can't be initialized. */
        world = "world";
        cprint ("%s %s\n", hello, world);       /* No stdio yet. */
}

K&R

#include <stdio.h>
main(argc,argv)
int argc;
char **argv;
{
        printf("Hello World\n");
        exit (0);
}

ANSI C

#include <stdio.h>
int main(int argc, char *argv[])
{
        printf("Hello World\n");
        return 0;
}

Compilers

See also

External links