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. Iostream processing\flags question

Iostream processing\flags question

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

    I'm using the stringstream and the operator << receiving data from a input string, like this: stringstream ss; ss.clear(); ss.str(""); ss << inputString; ------------- string outputString = ss.str(); The string is big and contains white spaces, etc. Sometimes the "outputString" string reflects the entire inputString, sometimes it's truncated until it reaches a white space...in the same project. Why it happens ? Is there any way\flag to reset any iostream data processing ? Thanks for any help.

    GuimaSun www.nexsun.com.br NEXSUN TechZone

    S 1 Reply Last reply
    0
    • G GuimaSun

      I'm using the stringstream and the operator << receiving data from a input string, like this: stringstream ss; ss.clear(); ss.str(""); ss << inputString; ------------- string outputString = ss.str(); The string is big and contains white spaces, etc. Sometimes the "outputString" string reflects the entire inputString, sometimes it's truncated until it reaches a white space...in the same project. Why it happens ? Is there any way\flag to reset any iostream data processing ? Thanks for any help.

      GuimaSun www.nexsun.com.br NEXSUN TechZone

      S Offline
      S Offline
      Stuart Dootson
      wrote on last edited by
      #2
      1. Can you give an example of a failing input string?

      2. You don't need these lines - the stringstream will be empty on cosntruction:

        ss.clear();
        ss.str("");

      3. Does using an ostringstream help (I doubt it)?

      Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

      G 1 Reply Last reply
      0
      • S Stuart Dootson
        1. Can you give an example of a failing input string?

        2. You don't need these lines - the stringstream will be empty on cosntruction:

          ss.clear();
          ss.str("");

        3. Does using an ostringstream help (I doubt it)?

        Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

        G Offline
        G Offline
        GuimaSun
        wrote on last edited by
        #3

        Problem solved using the .str() method, I finally could figure out a way to specialize my templates and use the unformated version with strings. Anyway, thanks a lot for your valuable tips.

        GuimaSun www.nexsun.com.br NEXSUN TechZone

        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