From mboxrd@z Thu Jan 1 00:00:00 1970 From: James Colannino Subject: comparing char to other known char's Date: Wed, 22 Jun 2005 16:22:47 -0700 Message-ID: <42B9F2C7.2030205@colannino.org> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: Sender: linux-c-programming-owner@vger.kernel.org List-Id: Content-Type: text/plain; charset="us-ascii" To: linux-c-programming@vger.kernel.org Hey everyone. I hope this isn't a stupid question. I've been googling around trying to find a function that I can use but haven't been successful. Here's what I want to be able to do: let's say I have a char called 'character.' I want to compare 'character' to see if it's any one of the characters in a list. For example, maybe I would want to test character to see if it's either 'e', 'r', '*', etc. Is this easy enough to implement? I could do if (character == 'e' || character == [...] and so on and so forth, but this seems much to tedious and unreadable to be my only solution. If anyone has any ideas I'd be extremely grateful :) Thanks very much in advance. James -- My blog: http://www.crazydrclaw.com/ My homepage: http://james.colannino.org/ "A well regulated militia being necessary to the security of a free state, THE RIGHT of the people to keep and bear arms SHALL NOT BE INFRINGED." --United States Constitution, Second Ammendment