Message-Id: <199907281320.JAA24759@delorie.com> From: "Dan Gold" To: Subject: Detecting a 0 and also a letter in atoi() Date: Tue, 26 Jan 1999 21:37:36 -0800 X-MSMail-Priority: Normal X-Priority: 3 X-Mailer: Microsoft Internet Mail 4.70.1155 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Reply-To: djgpp AT delorie DOT com Could be offtopic, but It I want to detect if there is a letter in my character boxes but atoi returns zero if there is a letter. This is poorly designed because I can't use the number 0 when converting the integer string to an int variable. I thought this would work but it didn't so could anyone type some code to do so? if (((t_box_r == "0") || ((color.r == atoi(t_box_r)) != 0)) && ((t_box_g == "0") || ((color.r == atoi(t_box_g)) != 0)) && ((t_box_b == "0" || ((color.r == atoi(t_box_b)) != 0))) { do stuff!!!!!.... } Thanks, for the help, I think there is a better way to structure the conditionals but it's got me... from Dan Gold -=-=[CATACOMB ABYSS]=-=- http://www.geocities.com/SiliconValley/Port/1547/