#include // Define an enum type and give it the name skyColorType: typedef enum skyColor {blue, orange, gray} skyColorType; // Define a type called "doublePointer": typedef double *doublePointer; // Define a string type: typedef char *forecastString; // This function takes a skycolorType and a doublePointer type // as parameters and returns a string type. forecastString forecast (skyColorType c, doublePointer temperature) { forecastString str = ""; if (c == blue) { str = "Sunny and warm!"; *temperature = 85.5; // Note: "temperature" is a pointer. } else if (c == orange) { str = "Enjoy the sunset"; *temperature = 77.3; } else if (c == gray) { str = "Stay inside"; *temperature = 64.7; } return str; } int main () { double temp; char *str; // Pass in a color and a pointer-to-double (the address), and // get back a string. The double "temp" gets modified in forecast. str = forecast (blue, &temp); printf ("Temperature = %lf: %s\n", temp, str); }