vimwiki

C typedef

Use to give a type a new name.
By convention the new name is capitalize.

typedef char *String;

String str = "hello there";

Renaming a struct

typedef struct node {
  // ...
} Node;

Function type

// type for function taking a char* and returning an int
typedef int (*Func)(char *);

Func myFunction;

Other uses