Difference between revisions of "C programming language"
From Computer History Wiki
(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...) |
(Corrected and made K&R version more typical. Added a little bit to the C history.) |
||
Line 8: | Line 8: | ||
<pre> | <pre> | ||
#include <stdio.h> | #include <stdio.h> | ||
− | + | main(argc,argv) | |
int argc; | int argc; | ||
− | char *argv; | + | char **argv; |
{ | { | ||
− | printf("Hello World\n"); | + | printf("Hello World\n"); |
− | + | exit (0); | |
} | } | ||
</pre> | </pre> | ||
− | + | 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 | + | C was derived[http://cm.bell-labs.com/cm/cs/who/dmr/chist.html] from an earlier language called [[B]] |
+ | |||
+ | A number of object-oriented languages have been influenced by C, including | ||
+ | [[Objective-C]], [[C++]], [[D]], [[Vala]]. | ||
{{stub}} | {{stub}} | ||
[[Category:Languages]] | [[Category:Languages]] |
Revision as of 15:40, 19 July 2010
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 was a ANSI standard to the C language, and it's usually refered to as just ANSI C.
hello world
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; }
C was derived[1] from an earlier language called B
A number of object-oriented languages have been influenced by C, including Objective-C, C++, D, Vala.