CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2001
    Posts
    1,029

    reading and writing a buffer using fstream?

    Hello all,

    I am reading a file and I want to read it into a buffer using fstream. anyone have any sample code to read and write files into a buffer?

    Thanks!

  2. #2
    Join Date
    Aug 2000
    Location
    West Virginia
    Posts
    7,725

    Re: reading and writing a buffer using fstream?

    1) what type of buffer (string , char [])

    2) do you want to read the entire file into memory at once ?

    3) here is a link for sample code ...

    http://www.nicoletti.50megs.com/cpp_...s/reading.html

  3. #3
    Join Date
    Apr 2001
    Posts
    1,029

    Re: reading and writing a buffer using fstream?

    I am using string's so that would work.. I just want to read part of the file into memory.. kind of like in C how you would parse a comment like this:

    /* blah blah blah */

    So I want to read when I encounter the "/*" and then read until I encounter the "*/"


    Later I want to write that comment back to another file

    Thanks!

  4. #4
    Join Date
    Apr 2001
    Posts
    1,029

    Re: reading and writing a buffer using fstream?

    Do you have any simple sample code for what I asked? I didnt understand the example in the link you posted

  5. #5
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: reading and writing a buffer using fstream?

    [ moved thread ]
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured