Include guards in C
A header may be included many times, so it must protect itself.
#ifndef TYPESTAR_TOUR_H
#define TYPESTAR_TOUR_H
#include <stddef.h>
typedef struct {
const char *slug;
size_t steps;
} Tour;
size_t tour_steps(const Tour *tour);
#endif /* TYPESTAR_TOUR_H */
How it works
- The guard macro is defined on the first pass.
- Later passes see it defined and skip the body.
- The name is conventionally the file name shouted.
Keywords and builtins used here
charconstsize_tstructtour_stepstypedef
The run, in numbers
- Lines
- 13
- Characters to type
- 194
- Tokens
- 33
- Three-star pace
- 100 tpm
At the three-star pace of 100 tokens a minute, this run takes about 20 seconds.
Step 1 of 2 in Headers & conditions, step 8 of 12 in Preprocessor & headers.