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. Char to string

Char to string

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

    How can i convert a value that is in char format: char news[16] to string? the simple sintax: CString str2 = news; str2.Format("%s"); doesn't seem to do it.

    _ N T 3 Replies Last reply
    0
    • T tanarnelinistit

      How can i convert a value that is in char format: char news[16] to string? the simple sintax: CString str2 = news; str2.Format("%s"); doesn't seem to do it.

      _ Offline
      _ Offline
      _AnsHUMAN_
      wrote on last edited by
      #2

      CString str2; str2.Format("%s",news); Will do this. Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_

      1 Reply Last reply
      0
      • T tanarnelinistit

        How can i convert a value that is in char format: char news[16] to string? the simple sintax: CString str2 = news; str2.Format("%s"); doesn't seem to do it.

        N Offline
        N Offline
        NiceNaidu fo
        wrote on last edited by
        #3

        chk this. http://www.thecodeproject.com/string/cstringmgmt.asp#char%20*%20to%20CString[^] Appu.. "If you judge people, you have no time to love them."

        S 1 Reply Last reply
        0
        • N NiceNaidu fo

          chk this. http://www.thecodeproject.com/string/cstringmgmt.asp#char%20*%20to%20CString[^] Appu.. "If you judge people, you have no time to love them."

          S Offline
          S Offline
          see me
          wrote on last edited by
          #4

          :laugh: y such a long link for this?????/ Dream bigger... Do bigger...Expect smaller aji

          N T 2 Replies Last reply
          0
          • S see me

            :laugh: y such a long link for this?????/ Dream bigger... Do bigger...Expect smaller aji

            N Offline
            N Offline
            NiceNaidu fo
            wrote on last edited by
            #5

            Keeping view of Beginners, I posted that.Itz really good link for Beginners. Appu.. "If you judge people, you have no time to love them."

            1 Reply Last reply
            0
            • T tanarnelinistit

              How can i convert a value that is in char format: char news[16] to string? the simple sintax: CString str2 = news; str2.Format("%s"); doesn't seem to do it.

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

              tanarnelinistit wrote:

              CString str2 = news; str2.Format("%s");

              this will do too, call argument constructor of CString class CString str2(news);

              "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

              cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and You

              1 Reply Last reply
              0
              • S see me

                :laugh: y such a long link for this?????/ Dream bigger... Do bigger...Expect smaller aji

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

                Its me wrote:

                :laugh: y such a long link for this?????/

                just a normal habit of programmer.... cut and paste :)

                "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

                cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and You

                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