Top "Fstream" questions

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

How to use std::getline() to read a text file into an array of strings in C++?

I am trying to use std::getline() in my project to read in a text file into an array of …

c++ arrays file-io fstream dynamic-arrays
How can I use non-default delimiters when reading a text file with std::fstream?

In my C++ code, I want to read from a text file (*.txt) and tokenize every entry. More specifically, I …

c++ fstream ifstream
Returning ifstream in a function

Here's probably a very noobish question for you: How (if at all possible) can I return an ifstream from a …

c++ fstream ifstream ofstream
std::fstream buffering vs manual buffering (why 10x gain with manual buffering)?

I have tested two writing configurations: Fstream buffering: // Initialization const unsigned int length = 8192; char buffer[length]; std::ofstream stream; stream.…

c++ file c++11 buffer fstream
Read 32-bit integer from binary file in C++?

My binary file looks like this. 00000000: 0000 0803 0000 ea60 0000 001c 0000 001c 00000010: 0000 0000 0000 0000 0000 0000 0000 0000 left column is address. I just tried to read 0000 0803(=2051) as follows …

c++ file fstream
Using fstream Object as a Function Parameter

#include <iostream.h> #include <fstream.h> #include <stdlib.h> void vowel(fstream a){ char …

c++ function fstream
Is it possible to pass cout or fout to a function?

I'm trying to find a way to pass fout or cout to a function. I realize there are logically easy …

c++ fstream ofstream
Reading a single character from an fstream?

I'm trying to move from stdio to iostream, which is proving very difficult. I've got the basics of loading a …

c++ file-io iostream fstream
How to read a json file into a C++ string

My code like this: std::istringstream file("res/date.json"); std::ostringstream tmp; tmp<<file.rdbuf(); std::string …

c++ json string fstream
Retrieving file descriptor from a std::fstream

Possible Duplicate: Getting a FILE* from a std::fstream I am working on Linux and file descriptors are the main …

c++ fstream file-descriptor