Path: utzoo!attcan!uunet!virtech!cpcahil From: cpcahil@virtech.UUCP (Conor P. Cahill) Newsgroups: comp.lang.c Subject: Re: Silly syntax Keywords: just for grins Message-ID: <1246@virtech.UUCP> Date: 7 Oct 89 13:19:13 GMT References: <9604@attctc.Dallas.TX.US> Distribution: na Organization: Virtual Technologies Inc Lines: 17 In article <9604@attctc.Dallas.TX.US>, bobc@attctc.Dallas.TX.US (Bob Calbridge) writes: > switch (expression) { > case f1(): do_this(); > > where f1...fn() may be functions that evaluate circumstances and return an > integer or get input from the user and return an integer. This is not allowed. The expression in a case statement MUST be a constant expression. A function call is not a constant. It looks like you are back to the old if-then-else stuff. -- +-----------------------------------------------------------------------+ | Conor P. Cahill uunet!virtech!cpcahil 703-430-9247 ! | Virtual Technologies Inc., P. O. Box 876, Sterling, VA 22170 | +-----------------------------------------------------------------------+