/** * A simple typedef example * @author gtowell * Created: March 2021 * **/ #include #include #define DOLLAR_FORMAT "$%.2f" // define a new type named "dollar" // typedefs should be global although you can make them local // but is it reasonable to do so? typedef float dollar; void pdollars(dollar d) { printf(DOLLAR_FORMAT, d); } int main(int argc, char * argv[]) { dollar money = 5.5; pdollars(money); printf("\n"); }