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. INT TO STRING?... help

INT TO STRING?... help

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
4 Posts 3 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.
  • L Offline
    L Offline
    lgmanuel
    wrote on last edited by
    #1

    i can't convert int to CString.. need help pls.. here is my code, i want to print whatever the value of count is on a STATIC TEXT Control.. count += 1; atoi(count); m_StaticText.SetWindowText(_T("try lang = ")+ count); i got------> error C2664: 'atoi' : cannot convert parameter 1 from 'int' to 'const char *' thanks ahead..

    C S 2 Replies Last reply
    0
    • L lgmanuel

      i can't convert int to CString.. need help pls.. here is my code, i want to print whatever the value of count is on a STATIC TEXT Control.. count += 1; atoi(count); m_StaticText.SetWindowText(_T("try lang = ")+ count); i got------> error C2664: 'atoi' : cannot convert parameter 1 from 'int' to 'const char *' thanks ahead..

      C Offline
      C Offline
      Cool_Dev
      wrote on last edited by
      #2

      you may use: CString str; str.Fomat(_T("try lang = %d", count); error is because your syntax for atoi() is wrong. i think it is itoa() that you really intended to use :)

      1 Reply Last reply
      0
      • L lgmanuel

        i can't convert int to CString.. need help pls.. here is my code, i want to print whatever the value of count is on a STATIC TEXT Control.. count += 1; atoi(count); m_StaticText.SetWindowText(_T("try lang = ")+ count); i got------> error C2664: 'atoi' : cannot convert parameter 1 from 'int' to 'const char *' thanks ahead..

        S Offline
        S Offline
        steviewang
        wrote on last edited by
        #3

        in these code : ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ m_StaticText.SetWindowText(_T("try lang = ")+ count); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ you can not add a string value to a integer value.

        C 1 Reply Last reply
        0
        • S steviewang

          in these code : ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ m_StaticText.SetWindowText(_T("try lang = ")+ count); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ you can not add a string value to a integer value.

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

          :)

          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