Given a means to obtain specific character codes, you could replace
type-denoting enumeration constants in the switch
statement with
character codes. For example, you could replace eng_code
with
'E'
:
switch (extract_car_code (input_buffer)) { case 'E': train[n] = new engine; break; ... }