C
Description
C is a general-purpose imperative programming language designed by Dennis M Ritchie and specified by the international standard ISO/IEC 9899. It is the main implementation language of UNIX, and of many important Open Source packages including the Linux kernel, Perl, Apache and Bind.
Compared to many programming languages, C provides relatively little abstraction between the programming environment and execution environment. This makes it well suited to embedded and system programming tasks where there is a need to tightly control how the compiled program will behave. For other uses its low-level nature is more likely to be a hinderance than a benefit, partly because of the opportunity it provides for making mistakes.
The most widely used Open Source implementation of C is gcc
(a front end to the GNU Compiler Collection) in combination with glibc
(the GNU C Library). Other notable ones include Clang (a front end to LLVM) and the Portable C Compiler (pcc).
microHOWTOs
- Calculate an Internet Protocol checksum in C
- Capture Ethernet frames using an AF_PACKET ring buffer in C
- Capture Ethernet frames using an AF_PACKET socket in C
- Capture the output of a child process in C
- Cause a process to become a daemon in C
- Convert an IP address to a human-readable string in C
- Convert an IP address to the corresponding domain name in C
- Determine the fully qualified hostname of the local machine in C
- Establish a TCP connection in C
- Get the IP address of a network interface in C using SIOCGIFADDR
- Get the MAC address of an Ethernet interface in C using SIOCGIFHWADDR
- Get the index number of a Linux network interface in C using SIOCGIFINDEX
- Get the size of a Linux block special device in C
- Ignore SIGPIPE without affecting other threads in a process
- Listen for and accept TCP connections in C
- Listen for and receive UDP datagrams in C
- Prevent a C or C++ header file from being compiled more than once
- Prevent a process from terminating when writing to a broken pipe
- Reap zombie processes using a SIGCHLD handler
- Round towards minus infinity when dividing integers in C or C++
- Safely parse an integer using the standard C library
- Send a UDP datagram in C
- Send an arbitrary Ethernet frame using an AF_PACKET socket in C
- Send an arbitrary IPv4 datagram using a raw socket in C
See also
Further reading
- Information technology — Programming languages — C, ISO/IEC 9899:2011, International Organisation for Standardization, 2011 (previously ISO/IEC 9899:1999 and ISO/IEC 9899:1990)
- Brian W. Kernighan and Dennis M. Ritchie, The C Programming Language, 2nd ed., Prentice Hall, 1988