Thread: Darn it, I need help =/

  1. #1
    Registered User
    Join Date
    Feb 2002
    Posts
    14

    Darn it, I need help =/

    I didn't want to do this, I was trying to write my first program all on my own without any help or ideas and I have it completed excpet for one small problem.

    I wrote a game and everything works just fine, except if you type any letter instead of a number it goes into an infinite loop, which causes a problem for the average user that doesnt know how to use the break.

    Does anyone know of a small snippet of code I can put into my program that will keep this from happening?

    JLTaylor

  2. #2
    Registered User
    Join Date
    Feb 2002
    Posts
    589
    Look into the standard function isdigit()

  3. #3
    Registered User
    Join Date
    Feb 2002
    Posts
    14
    Grrr,

    I try using int isalpha(int c); and I keep getting

    Expression syntax
    array bounds missing ]

    and yes I am using #include <ctype.h>

    JLTaylor

  4. #4
    Sayeh
    Guest
    You know, this board has a wealth of information on it, contributed by so many outstanding folks here--

    ---

    http://www.cprogramming.com/fod/isalpha.html

    enjoy

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Darn you VB!
    By FlyingIsFun1217 in forum C++ Programming
    Replies: 5
    Last Post: 09-05-2007, 11:07 PM
  2. Cant Figure Out This Darn Linker
    By Bluesun159 in forum C++ Programming
    Replies: 7
    Last Post: 07-02-2003, 05:20 AM
  3. Gosh darn it I hate my job
    By face_master in forum A Brief History of Cprogramming.com
    Replies: 31
    Last Post: 01-04-2003, 02:11 PM
  4. Those darn API's
    By Zahl in forum A Brief History of Cprogramming.com
    Replies: 6
    Last Post: 01-04-2003, 10:27 AM
  5. Another question with my darn program
    By Snoopy in forum C++ Programming
    Replies: 3
    Last Post: 01-22-2002, 04:33 PM