You can also use the STL
Code:
#include <algorithm>
#include <fstream>
#include <string>

...

std::string mystring;

...

file1 >> noskipws;
while (file1)
  {
  mystring.clear();
  copy_n(
    back_inserter( mystring ),
    350,
    istream_iterator <char> ( file1 )
    );
  mystring = my_function( mystring );
  file2 << mystring;
  }
If you are working with binary data, make sure to open the file with ios::binary mode.

You may not have the copy_n() template function. (Apparently it wasn't part of the last standard, alas.) Here it is:
Code:
  template <
    typename InputIterator,
    typename SizeType,
    typename OutputIterator
    >
  inline OutputIterator copy_n(
    InputIterator  first,
    SizeType       count,
    OutputIterator result
    ) {
    for (; count > 0; --count)
      *result++ = *first++;
    return result;
    }
Hope this helps.

[edit] Yeah, that fstream doesn't take std::string thing always gets me too... But you can always say:
Code:
ifstream foo( filename.c_str() );
Heh...