The final word on GOTO (Don't I wis

David Olix dwho at nmtvax.nmt.edu
Sat Oct 7 08:00:56 AEST 1989


In article <867 at crdos1.crd.ge.COM> davidsen at crdos1.UUCP (bill davidsen) writes:
>
>  [...] In the original the "donum:"
>code was only executed if a case was matched in the switch. [...]

Would the following be too terribly unreadble?

case_matched = 1;
switch (format_char)
{
  case 'd':  the stuff I put under d; break;
  case 'o':  the stuff I put under o; break;
  case 'x':  the stuff I put under x; break;
  case 'u':  the stuff I put under u; break;
  default:  case_matched = 0;
}
if (case_matched)
  the stuff I put under donum;


I'm not really arguing whether or not to use goto's here; I'm arguing that
adding one flag (case_matched) does not a 'whole lot of flags' make.

--David Olix (dwho at nmtvax.nmt.edu)



More information about the Comp.lang.c mailing list