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. Converting big integer value to string

Converting big integer value to string

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

    Hi All, I want convert BIG integer value to string for that i used _strtoi64 that convert values still 9,223,372,036,854,775,807 but for big value greated than "9,223,372,036,854,775,807" it gives wrong value have i convert greated than "9,223,372,036,854,775,807" value to string??. .

    L J C 3 Replies Last reply
    0
    • C Coder Block

      Hi All, I want convert BIG integer value to string for that i used _strtoi64 that convert values still 9,223,372,036,854,775,807 but for big value greated than "9,223,372,036,854,775,807" it gives wrong value have i convert greated than "9,223,372,036,854,775,807" value to string??. .

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      You cannot convert values greater than the maximum allowed for a 64 bit integer.

      Unrequited desire is character building. OriginalGriff I'm sitting here giving you a standing ovation - Len Goodman

      1 Reply Last reply
      0
      • C Coder Block

        Hi All, I want convert BIG integer value to string for that i used _strtoi64 that convert values still 9,223,372,036,854,775,807 but for big value greated than "9,223,372,036,854,775,807" it gives wrong value have i convert greated than "9,223,372,036,854,775,807" value to string??. .

        J Offline
        J Offline
        Jochen Arndt
        wrote on last edited by
        #3

        You already got answers to your same question in the Quick Answers question at [^]

        1 Reply Last reply
        0
        • C Coder Block

          Hi All, I want convert BIG integer value to string for that i used _strtoi64 that convert values still 9,223,372,036,854,775,807 but for big value greated than "9,223,372,036,854,775,807" it gives wrong value have i convert greated than "9,223,372,036,854,775,807" value to string??. .

          C Offline
          C Offline
          CPallini
          wrote on last edited by
          #4

          Either the title or your explanation is wrong. I guess you need to convert a string representing a very big number to, well, a big integer variable. As Jochen pointed out, we already answered your question at QA. However, if you really don't want to use a big integer library then may you roll you own version of, say, strtoi128, i.e. a function converting the given string into the 128 bit binary representation of the number (you may mimic the method used at school to perform division).

          If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
          This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
          [My articles]

          A 1 Reply Last reply
          0
          • C CPallini

            Either the title or your explanation is wrong. I guess you need to convert a string representing a very big number to, well, a big integer variable. As Jochen pointed out, we already answered your question at QA. However, if you really don't want to use a big integer library then may you roll you own version of, say, strtoi128, i.e. a function converting the given string into the 128 bit binary representation of the number (you may mimic the method used at school to perform division).

            If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
            This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
            [My articles]

            A Offline
            A Offline
            Albert Holguin
            wrote on last edited by
            #5

            If it doesn't exist... make it yourself... +5

            C 1 Reply Last reply
            0
            • A Albert Holguin

              If it doesn't exist... make it yourself... +5

              C Offline
              C Offline
              CPallini
              wrote on last edited by
              #6

              Thank you. However, I realize it would be a bit difficult for a newbie.

              If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
              This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
              [My articles]

              A 1 Reply Last reply
              0
              • C CPallini

                Thank you. However, I realize it would be a bit difficult for a newbie.

                If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                [My articles]

                A Offline
                A Offline
                Albert Holguin
                wrote on last edited by
                #7

                Definitely... but it is worth noting that they can do it themselves if need be.

                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