-
Create functions for each individual case:
void print_Lazer( Printer* pr /*etc.*/ );
void print_InkjetPrinter( Printer* pr /*etc.*/ );
void print_FaxMachine( Printer* pr /*etc.*/ );
void print( Printer* pr )
{
if ( pr->type == 'L' ) {
print_Lazer( Printer* pr /*etc.*/ );
} else if ( pr->type == 'I' ) {
print_InkjetPrinter( Printer* pr /*etc.*/ );
} else if ( pr->type == 'F' ) {
print_FaxMachine( Printer* pr /*etc.*/ );
}
}
|
|