Differences between revisions 4 and 7 (spanning 3 versions)
Revision 4 as of 2023-04-03 13:10:02
Size: 1376
Comment:
Revision 7 as of 2026-06-15 13:24:46
Size: 671
Comment: Rewrite
Deletions are marked like this. Additions are marked like this.
Line 11: Line 11:
== Example ==

A hello world program will look like:

{{{
#include <stdio.h>
int main() {
    printf("Hello World!\n");
    return 0;
}
}}}

To compile and run, try:

{{{
gcc -o hello hello.c
./hello
}}}

----



== Installation ==

A C compiler must be installed. Many [[Linux]] and [[BSD]] distributions will have one installed: either `gcc(1)` or `clang(1)`. All distributions will have packages for both available as well.

A C library (`libc(7)`) must also be installed. All distributions will have one installed. BSD distributions develop their own libraries, while most Linux distributions use `glibc`. Minimal Linux distributions such as [[Linux/Alpine|Alpine]] use `musl libc`.

----



== Language ==
== Syntax ==
Line 47: Line 14:
 * [[C/Include|Include]]

C

C is a statically-typed programming language. The design goals were minimalism and mirroring bare metal computer architecture, so as to simplify the process of porting C to new platforms. It allows low-level memory management and features a very concise standard library.

Contents

  1. C
    1. Syntax
    2. See also


Syntax


See also

GNU C user manual

gcc(1)

clang(1)


CategoryRicottone

C (last edited 2026-06-15 13:24:46 by DominicRicottone)