Hardware Reference
In-Depth Information
{
printf("\n");
}
}
menu()
{
scroll(1);
printf("MAIN MENU\n");
printf("=========\n");
printf("[1] Initialise the system\n");
printf("[2] Pump control\n");
printf("[3] Mixer control\n");
printf("[4] Delivery control\n");
printf("[5] Close down and exit\n");
scroll(1);
printf("Enter option required... ");
}
init()
{
scroll(2);
printf("INITIALISING SYSTEM - PLEASE WAIT!\n");
scroll(2);
/* More code goes here */
}
pump()
{
scroll(2);
printf("PUMP CONTROL\n");
scroll(2);
/* More code goes here */
}
mix()
{
scroll(2);
printf("MIXER CONTROL\n");
scroll(2);
/* More code goes here */
}
deliver()
{
scroll(2);
printf("DELIVERY CONTROL\n");
scroll(2);
/* More code goes here */
}
The output produced by the menu program is shown in Figure 7.9.
Passing arguments into main
A useful facility available within C running under MS-DOS is that of passing
arguments into programs from which the command line input by the user when
the program is first loaded. The main() function allows two arguments: argc
Search WWH ::




Custom Search