Top "Fstream" questions

fstream provides an iostream interface for file I/O in C++.

How to use std::ifstream to read in a binary file with a wide string path

I am reading a binary file as: const size_t stBuffer = 256; char buffer[stBuffer]; std::wstring wPath(L"blah"); std::…

c++ fstream
What is the difference between flush() and sync() in regard to fstream buffers?

I was reading the cplusplus.com tutorial on I/O. At the end, it says fstream buffers are synchronized with …

c++ stream buffer fstream ostream
how can I read exactly 128 bytes from an fstream into a string object?

How do I read exactly 128 bytes from an fstream into a string object? I wrote some code to read the …

c++ string iostream fstream ifstream
fstream ifstream I don't understand how to load a data file into my program

My professor is very smart but expects complete noobs like me to just know how to program c++. I don't …

c++ fstream ifstream ofstream
fstream in and out on nonexistent file

Is it possible to open an fstream on a file that does not exist with both ios::in & ios::…

c++ fstream
How to write to middle of a file in C++?

I think this should be quite simple, but my googling didn't help so far... I need to write to an …

c++ fstream ifstream ofstream
ifstream::open() function using a string as the parameter

I'm trying to make a program that asks for the file that they user would like to read from, and …

c++ string fstream ifstream
std::getline throwing when it hits eof

std::getline throws exception when it gets an eof. this is how I am doing. std::ifstream stream; stream.exceptions(…

c++ fstream eof getline
How do you search a document for a string in c++?

Here's my code so far: #include<iostream> #include<string> #include<fstream> using namespace std; …

c++ fstream ifstream ofstream
Setting file permissions when opening a file with ofstream

Is there a way in C++'s standard libraries (or linux sys/stat.h, sys/types.h, sys/.... libraries) to …

c++ linux file-permissions fstream