Thread: How to match digit and number in c++

  1. #1
    Registered User
    Join Date
    Oct 2017
    Posts
    37

    How to match digit and number in c++

    Hello
    how to match if or switch based char and digit
    like PB052
    if(a==PB052)
    ?

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    37,597
    Same answer as this -> How to store 15 digit number in C++

    In the narrowest interpretation, you can do this
    string a = "PB052";
    if(a=="PB052")

    Where is a coming from?
    How many possible values are there?
    How many are interesting to you?

    Your open-ended questions are best answered with either "go read a book" or "well it depends...."
    How To Ask Questions The Smart Way
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Adding a number digit by digit.
    By sdfx in forum C Programming
    Replies: 4
    Last Post: 05-10-2011, 05:54 PM
  2. Replies: 2
    Last Post: 10-31-2009, 06:49 PM
  3. Adding a Large number digit by digit
    By mejv3 in forum C Programming
    Replies: 23
    Last Post: 09-21-2007, 03:00 PM
  4. Adding a Large number digit by digit
    By mejv3 in forum C Programming
    Replies: 1
    Last Post: 09-14-2007, 03:28 AM
  5. outputs number digit by digit
    By Unregistered in forum C++ Programming
    Replies: 14
    Last Post: 05-17-2002, 04:43 PM

Tags for this Thread