how to separate char from int inputs using cpp

Discussion in 'C++' started by bareon, Jul 6, 2010.

  1. bareon

    bareon New Member

    Joined:
    Jul 6, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    none
    Location:
    philippines
    hellow 2 evry 1.....

    plz help me. Big PROBLEM......

    Please give me a code in cpp that will input you an integer and displays the input integer, but when a user inputs a character, the program would display
    that the input is invalid because it's a character.
     
  2. NewsBot

    NewsBot New Member

    Joined:
    Dec 2, 2008
    Messages:
    1,267
    Likes Received:
    2
    Trophy Points:
    0
    Moved the thread to Cpp Programming and regarding your query you should just be checking it with isalpha function or even can test using ascii values of 0-9
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice