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. string editing

string editing

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

    is it possible to add characters to the beggining or end of a string, ir so where can i learn, thanks a lot

    N C 2 Replies Last reply
    0
    • M moraalg

      is it possible to add characters to the beggining or end of a string, ir so where can i learn, thanks a lot

      N Offline
      N Offline
      Nish Nishant
      wrote on last edited by
      #2

      You can use a CString and simply add the strings using + Or you can use strcat if you are using char strings [Better use TCHAR and _tcscat] Nish


      Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]

      1 Reply Last reply
      0
      • M moraalg

        is it possible to add characters to the beggining or end of a string, ir so where can i learn, thanks a lot

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        I suspect by string you mean a char *, in which case the answer is strcat. Better to use std::string like this string s = "fish"; s = "eat more " + s; s = s + " to be more fit"; s now equals "eat more fisn to be more fit'. Christian NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma

        P 1 Reply Last reply
        0
        • C Christian Graus

          I suspect by string you mean a char *, in which case the answer is strcat. Better to use std::string like this string s = "fish"; s = "eat more " + s; s = s + " to be more fit"; s now equals "eat more fisn to be more fit'. Christian NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma

          P Offline
          P Offline
          Peter Hancock
          wrote on last edited by
          #4

          Christian Graus wrote: s now equals "eat more fisn to be more fit'. What's a fisn? Do they taste good? ;) And they still ran faster and faster and faster, till they all just melted away, and there was nothing left but a great big pool of melted butter

          C 1 Reply Last reply
          0
          • P Peter Hancock

            Christian Graus wrote: s now equals "eat more fisn to be more fit'. What's a fisn? Do they taste good? ;) And they still ran faster and faster and faster, till they all just melted away, and there was nothing left but a great big pool of melted butter

            C Offline
            C Offline
            Christian Graus
            wrote on last edited by
            #5

            Peter Hancock wrote: What's a fisn? Do they taste good? Sure do, especially if you have them with chipn. Christian NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma

            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