Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!pilot.njin.net!princeton!udel!haven!aplcen!uakari.primate.wisc.edu!dali.cs.montana.edu!milton!ogicse!husc6!m2c!umvlsi!star.ecs.umass.edu From: breck@star.ecs.umass.edu (Liam Breck) Newsgroups: comp.lang.c Subject: lookuptables vs switch(x) Message-ID: <1351@umvlsi.ecs.umass.edu> Date: 17 Nov 90 17:29:32 GMT Sender: news@umvlsi.ecs.umass.edu Distribution: usa Organization: University of Massachusetts, Amherst Lines: 12 Hello World, I need to use one value to get a string from a list of values and strings about 30 elements long. I can think of two ways of doing it: using an array of structures and a loop to search the array for the desired value or a switch statement with 30 case labels. Which is faster? If I put the switch in its own function how much will that slow things down? thanx Liam Breck