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. ATL / WTL / STL
  4. how to implement CStdioFile::WriteLine() with native C++ and STL?

how to implement CStdioFile::WriteLine() with native C++ and STL?

Scheduled Pinned Locked Moved ATL / WTL / STL
c++helptutorialquestion
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.
  • S Offline
    S Offline
    steven_wong
    wrote on last edited by
    #1

    hello, everyone: I want to operate files without MFC. Exactly speaking, i want to read and write files only with windows standard library. now i dont know how to implement the function of CStdioFile::WriteLine() of MFC with STL,is there anyone could help me?anything will be appreciated,thanks in advance~

    J 1 Reply Last reply
    0
    • S steven_wong

      hello, everyone: I want to operate files without MFC. Exactly speaking, i want to read and write files only with windows standard library. now i dont know how to implement the function of CStdioFile::WriteLine() of MFC with STL,is there anyone could help me?anything will be appreciated,thanks in advance~

      J Offline
      J Offline
      Jorgen Sigvardsson
      wrote on last edited by
      #2

      I suspect you are referring to CStdioFile::WriteString() and not WriteLine(). All you have to make sure is that single new lines (\n) are converted to carriage return and new line (\r\n). I would imagine that the std::fstream class handles this automatically, assuming the file was opened in text mode.

      S 1 Reply Last reply
      0
      • J Jorgen Sigvardsson

        I suspect you are referring to CStdioFile::WriteString() and not WriteLine(). All you have to make sure is that single new lines (\n) are converted to carriage return and new line (\r\n). I would imagine that the std::fstream class handles this automatically, assuming the file was opened in text mode.

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

        Thank u for your reply~ ;P std::fstream really helps me.

        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