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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. I need help in timers or conversions

I need help in timers or conversions

Scheduled Pinned Locked Moved C / C++ / MFC
help
5 Posts 4 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.
  • S Offline
    S Offline
    Snyp
    wrote on last edited by
    #1

    I want to make the user of the program be able to type in a number and let the timer count to the number but I keep on getting the wrong output. I put a int and string variable. if(m_iCount == m_sCountTo) Help:confused: [It is possible to represent everything in this universe by using 0 and 1] I'm going to live forever or die trying.

    D A P 3 Replies Last reply
    0
    • S Snyp

      I want to make the user of the program be able to type in a number and let the timer count to the number but I keep on getting the wrong output. I put a int and string variable. if(m_iCount == m_sCountTo) Help:confused: [It is possible to represent everything in this universe by using 0 and 1] I'm going to live forever or die trying.

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      You can't compare an int to a string (unless the appropriate overloaded operators have been implemented).

      1 Reply Last reply
      0
      • S Snyp

        I want to make the user of the program be able to type in a number and let the timer count to the number but I keep on getting the wrong output. I put a int and string variable. if(m_iCount == m_sCountTo) Help:confused: [It is possible to represent everything in this universe by using 0 and 1] I'm going to live forever or die trying.

        A Offline
        A Offline
        Anonymous
        wrote on last edited by
        #3

        if(m_iCount == atoi(m_sCountTo)) ...

        S 1 Reply Last reply
        0
        • S Snyp

          I want to make the user of the program be able to type in a number and let the timer count to the number but I keep on getting the wrong output. I put a int and string variable. if(m_iCount == m_sCountTo) Help:confused: [It is possible to represent everything in this universe by using 0 and 1] I'm going to live forever or die trying.

          P Offline
          P Offline
          PremL
          wrote on last edited by
          #4

          I suggest you keep the counter and the target value in integer format. This way you can compare them easily and perform a lot of other operations like increment easily. You’ll need to convert from string to int, when the user enters the value. For display purposes you can either format the integer into a nice looking string, or display it directly. Lorenz Prem Microsoft Corporation

          1 Reply Last reply
          0
          • A Anonymous

            if(m_iCount == atoi(m_sCountTo)) ...

            S Offline
            S Offline
            Snyp
            wrote on last edited by
            #5

            THANK YOU!!!! IT WORKS!!!! :laugh::laugh::laugh::laugh::laugh::laugh: [It is possible to represent everything in this universe by using 0 and 1] I'm going to live forever or die trying.

            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