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. Displaying a " in the string

Displaying a " in the string

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

    Hi all, I am trying to display a char string that contains following character: " (one double quote). If I write:

    char * c = " some string " ";

    Now you see the problem I encounter, The second quote is taken as end of the string. But I want it to be displayed inside the string. So, how can I manage to display: some string " Thanks !

    G 1 Reply Last reply
    0
    • B bigdenny200

      Hi all, I am trying to display a char string that contains following character: " (one double quote). If I write:

      char * c = " some string " ";

      Now you see the problem I encounter, The second quote is taken as end of the string. But I want it to be displayed inside the string. So, how can I manage to display: some string " Thanks !

      G Offline
      G Offline
      George L Jackson
      wrote on last edited by
      #2

      You use the escape character "\": char* c = " some string \" ";

      "We make a living by what we get, we make a life by what we give." --Winston Churchill

      B 1 Reply Last reply
      0
      • G George L Jackson

        You use the escape character "\": char* c = " some string \" ";

        "We make a living by what we get, we make a life by what we give." --Winston Churchill

        B Offline
        B Offline
        bigdenny200
        wrote on last edited by
        #3

        Thanks George !

        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