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

Conversion from integer to string

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorial
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.
  • J Offline
    J Offline
    jazzlycool
    wrote on last edited by
    #1

    Hi!! I need some help here. How to convert an integer variable to string so that the string and the variable can be concatenated. The string will be displayed in the edit control. Thanks jazzlycool

    J B J R 4 Replies Last reply
    0
    • J jazzlycool

      Hi!! I need some help here. How to convert an integer variable to string so that the string and the variable can be concatenated. The string will be displayed in the edit control. Thanks jazzlycool

      J Offline
      J Offline
      jmkhael
      wrote on last edited by
      #2

      CString str; str.Format("%d", intValue); char acBuffer[16] = {0}; sprintf(acBuffer, "%d", intValue); Papa while (TRUE) Papa.WillLove ( Bebe ) ;

      1 Reply Last reply
      0
      • J jazzlycool

        Hi!! I need some help here. How to convert an integer variable to string so that the string and the variable can be concatenated. The string will be displayed in the edit control. Thanks jazzlycool

        B Offline
        B Offline
        bikram singh
        wrote on last edited by
        #3

        Without using MFC: int Number = 178; char szString[50]; wsprintf(szString,"%d",Number); /*gives the string in decimal : "178"*/ or itoa(Number,szString,10); /*gives the string in decimal : "178"*/ or itoa(Number,szString,2); /*gives the string in binary : "10110010"*/ ~Bikram~

        1 Reply Last reply
        0
        • J jazzlycool

          Hi!! I need some help here. How to convert an integer variable to string so that the string and the variable can be concatenated. The string will be displayed in the edit control. Thanks jazzlycool

          J Offline
          J Offline
          jazzlycool
          wrote on last edited by
          #4

          Thanks for helping me. jazzlycool

          1 Reply Last reply
          0
          • J jazzlycool

            Hi!! I need some help here. How to convert an integer variable to string so that the string and the variable can be concatenated. The string will be displayed in the edit control. Thanks jazzlycool

            R Offline
            R Offline
            Rafael Fernandez Lopez
            wrote on last edited by
            #5

            CString my_string; int my_int = 54; my_string.Format("The value is: %d", my_int);


            Written by: Rafael Fernández López.

            Visit: http://www.maestroprogramador.com

            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