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. Conversion from int to basic string

Conversion from int to basic string

Scheduled Pinned Locked Moved C / C++ / MFC
jsonquestion
27 Posts 9 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.
  • I itkid

    Hi Friend, Is there any API which convert int(int a) to basic string(string b)? itoa can convert a(int) to char*(Char *c) and I can get b from c.However is there any other way? Thanks :)

    N Offline
    N Offline
    Nishad S
    wrote on last edited by
    #2

    wsprintf(str,"%d",n) is another way ;) - NS -

    C 1 Reply Last reply
    0
    • I itkid

      Hi Friend, Is there any API which convert int(int a) to basic string(string b)? itoa can convert a(int) to char*(Char *c) and I can get b from c.However is there any other way? Thanks :)

      T Offline
      T Offline
      toxcct
      wrote on last edited by
      #3

      sorry buddy, i really don't understand your question. will you please rephrase ?

      N 1 Reply Last reply
      0
      • T toxcct

        sorry buddy, i really don't understand your question. will you please rephrase ?

        N Offline
        N Offline
        Naveen
        wrote on last edited by
        #4

        some times, its because ur from another planet:laugh: nave

        N T 2 Replies Last reply
        0
        • N Naveen

          some times, its because ur from another planet:laugh: nave

          N Offline
          N Offline
          Nishad S
          wrote on last edited by
          #5

          what do you mean? :confused: - NS -

          T N 2 Replies Last reply
          0
          • N Naveen

            some times, its because ur from another planet:laugh: nave

            T Offline
            T Offline
            toxcct
            wrote on last edited by
            #6

            ;P but what did you do to my thread ?! :rolleyes::laugh:

            N 1 Reply Last reply
            0
            • N Nishad S

              what do you mean? :confused: - NS -

              T Offline
              T Offline
              toxcct
              wrote on last edited by
              #7

              remember the discussion below[^]

              1 Reply Last reply
              0
              • N Nishad S

                what do you mean? :confused: - NS -

                N Offline
                N Offline
                Naveen
                wrote on last edited by
                #8

                don't u know v2.0 is from another planet(An alien with vc++ knowledge) nave

                T 1 Reply Last reply
                0
                • N Nishad S

                  wsprintf(str,"%d",n) is another way ;) - NS -

                  C Offline
                  C Offline
                  Cedric Moonen
                  wrote on last edited by
                  #9

                  I think he was asking how to convert an integer into a std::string directly

                  I 1 Reply Last reply
                  0
                  • N Naveen

                    don't u know v2.0 is from another planet(An alien with vc++ knowledge) nave

                    T Offline
                    T Offline
                    toxcct
                    wrote on last edited by
                    #10

                    :-D he might have jump over the post but now, it's cool, anybody knows... :->

                    1 Reply Last reply
                    0
                    • T toxcct

                      ;P but what did you do to my thread ?! :rolleyes::laugh:

                      N Offline
                      N Offline
                      Naveen
                      wrote on last edited by
                      #11

                      :doh: sorry don't attack my earth for my mistake...Please:(( nave

                      T N 2 Replies Last reply
                      0
                      • C Cedric Moonen

                        I think he was asking how to convert an integer into a std::string directly

                        I Offline
                        I Offline
                        itkid
                        wrote on last edited by
                        #12

                        U r right!!

                        N 1 Reply Last reply
                        0
                        • N Naveen

                          :doh: sorry don't attack my earth for my mistake...Please:(( nave

                          N Offline
                          N Offline
                          Nishad S
                          wrote on last edited by
                          #13

                          If he do so we can pause him... ;) He is providing C:\> prompt... Just type "pause" command there... :) - NS -

                          N 1 Reply Last reply
                          0
                          • N Naveen

                            :doh: sorry don't attack my earth for my mistake...Please:(( nave

                            T Offline
                            T Offline
                            toxcct
                            wrote on last edited by
                            #14

                            hey, don't worry, i'm a pacific intergalactic traveler... my only purpose is to provide C/C++ knowledge around our universe ;)

                            N 1 Reply Last reply
                            0
                            • I itkid

                              U r right!!

                              N Offline
                              N Offline
                              Nishad S
                              wrote on last edited by
                              #15

                              Sorry I am not familar with that... - NS -

                              1 Reply Last reply
                              0
                              • N Nishad S

                                If he do so we can pause him... ;) He is providing C:\> prompt... Just type "pause" command there... :) - NS -

                                N Offline
                                N Offline
                                Naveen
                                wrote on last edited by
                                #16

                                v2.0 ... What does the c:\> prompt in ur profile indicates.. nave

                                T 1 Reply Last reply
                                0
                                • T toxcct

                                  hey, don't worry, i'm a pacific intergalactic traveler... my only purpose is to provide C/C++ knowledge around our universe ;)

                                  N Offline
                                  N Offline
                                  Nishad S
                                  wrote on last edited by
                                  #17

                                  I have posted some suggestions about VisualCalc... Did you see that? - NS -

                                  T 1 Reply Last reply
                                  0
                                  • N Naveen

                                    v2.0 ... What does the c:\> prompt in ur profile indicates.. nave

                                    T Offline
                                    T Offline
                                    toxcct
                                    wrote on last edited by
                                    #18

                                    it indicates that you are at the root directory on the C: drive :rolleyes:

                                    N N 2 Replies Last reply
                                    0
                                    • N Nishad S

                                      I have posted some suggestions about VisualCalc... Did you see that? - NS -

                                      T Offline
                                      T Offline
                                      toxcct
                                      wrote on last edited by
                                      #19

                                      i did ;)

                                      1 Reply Last reply
                                      0
                                      • T toxcct

                                        it indicates that you are at the root directory on the C: drive :rolleyes:

                                        N Offline
                                        N Offline
                                        Nishad S
                                        wrote on last edited by
                                        #20

                                        Means we have to uncover a lot... right? And we are only at the root... ( philosophy ) :) - NS -

                                        1 Reply Last reply
                                        0
                                        • I itkid

                                          Hi Friend, Is there any API which convert int(int a) to basic string(string b)? itoa can convert a(int) to char*(Char *c) and I can get b from c.However is there any other way? Thanks :)

                                          S Offline
                                          S Offline
                                          Stephen Hewitt
                                          wrote on last edited by
                                          #21

                                          Here's how I'd go about doing it: ostringstream ss; ss << "PI = " << 3.14159265; string s = ss.str(); Includes you'll need:  <string>  <sstream> Assumes:  using namespace std; Steve

                                          I 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