~foura/biobuf.link

ref: 5a6f0b68de68245706262a8122da729075170b99 biobuf.link/db/c -rw-r--r-- 634 bytes
5a6f0b68james palmer add c notes a month ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
| desc notes on the c programming language
| date 2020-09-10

* style
- never use #include in headers, never use #ifdef header guards.
- use /* c style comments */, not // c++ style comments
- seperate typedefs from structs and enums,
  it makes it easier to search, and makes structs that reference
  themselves cleaner

# typedef struct Node Node;
  struct Node {
      int val;
      Node left, right;
  }

- capitalized type names.
- lowercase function names.
- write the type at the start of functions that operate on that type.
  it makes code easier to search.

# typedef struct List List;
  void listappend(List *l, int v);