comp.lang.c
[Top] [All Lists]

Re: case labels

Subject: Re: case labels
From: "christian.bau"
Date: Fri, 28 Mar 2008 16:24:33 -0700 PDT
Newsgroups: comp.lang.c

On Mar 28, 5:48 pm, aark...@xxxxxxxxx wrote:

> why are constant integer expressions required in case labels of the
> switch statement? what would be the impact of allowing general integer
> expressions instead of constant integer expressions? discuss both user
> convenience and implementation aspects?

Consider

  switch (i) {
    case f (): printf ("f"); break;
    case g (): printf ("g"); break;
  }

Discuss under user convenience, implementation, and general mental
health aspects.

<Prev in Thread] Current Thread [Next in Thread>
Privacy Policy