AnatomyOf

Anatomy of a C file

example.c
1#include <stdio.h>
2
3int counter = 0;
4
5void announce(char *name) {
6 printf("Hello, %s!\n", name); // %s: trust me, it's a string
7}
8
9int main(void) {
10 if (counter == 0) {
11 announce("world");
12 }
13 return 0; // 0 means it worked; ask no further questions
14}
C is a compiled, procedural programming language known for its efficiency and low-level memory access.