The C Programming Language
C is a general-purpose programming language created by Dennis Ritchie at the Bell Laboratories in 1972. It is fairly popular, despite being old. It is strongly associated with UNIX, as it was developed to write the UNIX operating system (Linux).
C has almost the same syntax as C++, and very similar to most other programming languages, like java, python...
Compared to C++, C++ was initially developed as an extension of C. The main difference is that C++ supports classes and objects, while C does not. (see Object Oriented Programming.)
By design, C's features cleanly reflect the capabilities of the targeted CPUs. It has found lasting use in operating systems code (especially in kernels), device drivers, microcontrollers and digital signal processors (DSPs), and protocol stacks, but its use in application software has been decreasing starkly. C is commonly used on computer architectures that range from the largest supercomputers to the smallest microcontrollers and embedded systems.
C is an imperative, procedural language in the ALGOL tradition. It has a static type system. In C, all executable code is contained within subroutines (also called functions
, though not in the sense of functional programming). Function parameters are passed by value, although arrays are passed as pointers, i.e. the address of the first item in the array. Pass-by-reference is simulated in C by explicitly passing pointers to the thing being referenced.
A Simple C Programme
The execution of the following C programme prints Hello World!
on the computer's screen:
#include <stdio.h> int main() { printf("Hello, World!\n"); return 0; }
...
Relations to other languages
Many later languages have borrowed directly or indirectly from C, including C++, C#, Unix's C shell, D, Go, Java, JavaScript (including transpilers), Julia, Limbo, LPC, Objective-C, Perl, PHP, Python, Ruby, Rust, Swift, Verilog and SystemVerilog (hardware description languages). These languages have drawn many of their control structures and other basic features from C. Most of them also express highly similar syntax to C, and they tend to combine the recognizable expression and statement syntax of C with underlying type systems, data models, and semantics that can be radically different.