correction: isdigit diay

sample program:


/************************************************************************
 *
 * Purpose: Program to demonstrate the following functions:
 *     isalpha, isdigit, isspace. 
 *     The same principles apply to isalnum, iscntrl, isgraph, 
 *          islower, isprint, ispunct, isupper, isxdigit
 *
 * Author:  M. J. Leslie
 * Date:    09-Mar-94
 *
 ************************************************************************/

#include <stdio.h>     /* printf  */
#include <ctype.h>   /* isalpha isdigit isspace etc   */

#define FALSE 0
#define TRUE  1

    /* function declarations   */
int char_type(char);

main()
{
  char ch;
   /* get a character from the keyboard  */
  printf(" Please enter a charcater => ");
  ch = getc(stdin);

  char_type(ch); /* Figure out the character type  */
}

/****************************************************************
  decide the character type.
*****************************************************************/
int char_type(char ch)
{
   /* returns non zero if A-Z or a-z  */
  if ( isalpha(ch) != FALSE)
    printf("%c is an Alpha character.\n",ch);

   /* returns non zero if 0-9    */
  if ( isdigit(ch) != FALSE)
    printf("%c is a numeric character.\n",ch);

   /* returns non zero if a space, CR, Tab, NL FF  */
  if ( isspace(ch) != FALSE)
    printf("%c is white space\n", ch);

}




Camilo III Lozano <[EMAIL PROTECTED]> wrote: how can i rip off in C the non 
integer charaters?
  
 ===============================
  
 int main()
 {
    char *messy = ":428:";
     int cleaned = 0;
  
    //some removing syntax for the non integer chars
  
  
   cleaned = (int)(messy);
   return 0;
 }
  
 ===============================

 anybody can help? thanks...
 
-- 
--------------------
http://www.metacatalyst.com
http://www.metacatalyst.org
http://www.zabyer.org 

Got my Own Hacker Key:
v3sw3BHhw5ln2pr5OFPck3ma2u4MLw5XVm+5l5UCi5Ne4t3b5en5g5RaIs5MSr3p2
http://www.hackerkey.com

Registered Linux User: #439468 
 _________________________________________________
Kagay-Anon Linux Users' Group (KLUG) Mailing List
[email protected] (http://cdo.linux.org.ph)
Searchable Archives: http://archives.free.net.ph


Kolosos, COE
Philippines
Linux Registered User # 373129
       
---------------------------------
Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, 
photos & more. 
_________________________________________________
Kagay-Anon Linux Users' Group (KLUG) Mailing List
[email protected] (http://cdo.linux.org.ph)
Searchable Archives: http://archives.free.net.ph

Reply via email to