isdigit() function

This is a discussion on isdigit() function within the C++ Programming forums, part of the General Programming Boards category; Hey, I'm trying to use the isdigit() function on a character eg string[position].isdigit() but I don't know which class to ...

  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, 07:39 AM
  5. Question..
    By pode in forum Windows Programming
    Replies: 12
    Last Post: 12-19-2004, 07:05 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21