typedef allows the programmer to define new types
#include <stdio.h>
/* Code illustrating typedef */
(typedefs are usually found in header files) */
/* Define String as an alias for char * */
typedef char * String;
/* Define Boolean as an alias for an enum */
typedef enum{FALSE, TRUE} Boolean;
/* WAS
struct point {
int x;
int y;
};
*/
typedef struct {
int x;
int y;
} Point;
main()
{
/* WAS
struct point p;
struct point * pp;
*/
Point p;
Point * pp;
p.x = 3;
p.y = 4;
printf("x: %d, y: %d\n", p.x, p.y);
pp = &p;
printf("x: %d, y: %d\n", pp->x, pp->y);
}