The C++ Data Types
the typedef keyword is used to define new type specifiers,
typedef char* String; String a = “hello”;
typedef unsigned long Age; Age Stone_Age;
the enum keyword is used to define discrete data types,
enum Boolean {false,true}; Boolean unordered = false;
enum Long_Work_Day { Monday = 1, Tuesday, Thursday};
Long_Work_Day X = 2; // X is initialized to Tuesday
void* is used to define generic pointers,
int ival, *pi = 0; char *pc = 0; void *pv; pv = pi ; pv = pc // OK, implicit
// conversion, pv can be made to point to different variable data types
pc = pv // Error, pc must only point to char type objects
pc = (char*) pv ; // Ok, since pv is casted to point to char type objects
const int *pci = &ival; pv = pci // Error, pci is a pointer to a const data type
pv = (void *) pci // Ok, explicit casting away from constness