Thread: isdigit() function

  1. #1
    Registered User
    Join Date
    Apr 2005
    Posts
    11

    isdigit() function

    Hey,

    I'm trying to use the isdigit() function on a character eg
    string[position].isdigit()

    but I don't know which class to #include for this to work.
    Does anyone know which one I need to include? I've tried #include <string>, #include <cstdlib> and #include <locale> but it still says that it can't find the function isdigit().

    Thanks,
    Conor.

  2. #2
    Registered User
    Join Date
    Oct 2004
    Posts
    32
    Unix man pages says its ctype.h

  3. #3
    Registered User
    Join Date
    Apr 2005
    Posts
    11
    Thanks.

    I am indeed an idiot though, it's
    isdigit(string[position])
    not
    string[position.isdigit()].

    I got too used to programmin in Eiffel.

    Conor.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling sample DarkGDK Program
    By Phyxashun in forum Game Programming
    Replies: 6
    Last Post: 01-27-2009, 03:07 AM
  2. Including lib in a lib
    By bibiteinfo in forum C++ Programming
    Replies: 0
    Last Post: 02-07-2006, 02:28 PM
  3. Game Pointer Trouble?
    By Drahcir in forum C Programming
    Replies: 8
    Last Post: 02-04-2006, 02:53 AM
  4. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  5. Question..
    By pode in forum Windows Programming
    Replies: 12
    Last Post: 12-19-2004, 07:05 PM