TYPEDEF

this is used to define new data types. its main use is to define custom types for structures.

ALIAS FOR EXISTING TYPE

#SYNTAX
typedef existingTypeName newTypeName;
#include <stdio.h>

int main(int argc, char *argv[])
{
  typedef unsigned char uchar;                    //uchar is an alias for unsigned char
  uchar characterName = 'a';
  printf("character inside main: %c\n", characterName);
  
  return 0;
}

Last updated