Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. alphanumaric and numeric checking

alphanumaric and numeric checking

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    Omegaclass
    wrote on last edited by
    #1

    right now i am in a c++ class and even though the questions don't require validation i still lose points on my work i submit, i need to cover my bases here, can anyone help me find a way to reject alphanumeric values and accept only numeric ones? thanks to anyone who can help.

    _ 1 Reply Last reply
    0
    • O Omegaclass

      right now i am in a c++ class and even though the questions don't require validation i still lose points on my work i submit, i need to cover my bases here, can anyone help me find a way to reject alphanumeric values and accept only numeric ones? thanks to anyone who can help.

      _ Offline
      _ Offline
      _Superman_
      wrote on last edited by
      #2

      You can check if a character is a digit either using the isdigit[^] function or by checking if its ASCII value is between 48 and 57.

      «_Superman_» I love work. It gives me something to do between weekends.
      Microsoft MVP (Visual C++)

      O 1 Reply Last reply
      0
      • _ _Superman_

        You can check if a character is a digit either using the isdigit[^] function or by checking if its ASCII value is between 48 and 57.

        «_Superman_» I love work. It gives me something to do between weekends.
        Microsoft MVP (Visual C++)

        O Offline
        O Offline
        Omegaclass
        wrote on last edited by
        #3

        thank you, this look easy to implement into my programs.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups