Some ressources online:
- C programming a modern approach
- How to C in 2016
- A critique of "How to C in 2016"
- learn-c.org
- Modern C
- Driving compilers about how a compiler and linker works
- All Beej's Guides, like C programming, C Library reference, Network programming
- 50+ Data Structure and Algorithms Interview Questions for Programmers
- Bit Twiddling Hacks
cc -g3 -Wall -Wextra -Wconversion -Wdouble-promotion -fsanitize=undefined -fsanitize-trap
Or:
cc -std=c11 -pedantic
- indent
- clang-format
Which type is time_t on my OS ?
echo | cc -E -xc -include 'time.h' - | grep time_t
On x64 FreeBSD it is a int64_t:
typedef __int64_t __time_t;
typedef __int64_t __sbintime_t;
typedef __time_t time_t;
(etc.)
On 32bit FreeBSD it is a int32_t:
typedef __int32_t __time_t;
typedef __time_t time_t;
time_t tv_sec;
(etc.)
On x64 Linux it is a long:
typedef long int __time_t;
# 1 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 3 4
typedef __time_t time_t;
(etc.)