Skip to main content
1 vote
1 answer
85 views

I have a very simple scenario that looks like std::ifstream file("myfile.txt"); std::string discard; int num; file >> discard >> num; // to consume e.g. HEADER 55 Despite all ...
avigt's user avatar
  • 600
2 votes
1 answer
60 views

I am puzzled by the output of the code below: std::string content = "abcdefghijklmnopqrstuvwxyz1234567890"; std::istringstream iss(content); iss.seekg(10); std::istreambuf_iterator<char&...
Chen's user avatar
  • 330
0 votes
0 answers
118 views

I have implemented a drag-and-drop receiver (C++, WINAPI). It allows me to get a storage with a dragged object (OLE IStorage object). I need to "convert" it to a byte array (something like a ...
LUN's user avatar
  • 359
1 vote
1 answer
106 views

I have to write a stream extraction operator>> function which checks if the istream variable (stream) in the parameter is valid before returning it along with a delimiter (which is already ...
Cevapi Man69's user avatar
1 vote
0 answers
48 views

So currently working on some exercises on I/O, my code basically takes a string from input and removes the vowels at input: ExerciseClass.cpp: NoVowelString& NoVowelString::operator>>(std::...
user27170131's user avatar
1 vote
2 answers
99 views

My code skipped over the cin under the while loop reading an unknown number of inputs. I wanted to run the code int curval = 0, val = 0; while(std::cin >> curval){ val++; } ...
David Lee's user avatar
0 votes
0 answers
77 views

I am using a library that has a function taking an iostream for a data stream, but I want to pass std::cin. It apparently is not possible to pass an istream to an iostream, but is there way around ...
Robert Heller's user avatar
-1 votes
2 answers
118 views

I have the separate_by_delimiter function which is used inside another function outside_func std::vector<std::string> separate_by_delimiter(std::istream &input, int num_separators, char ...
Pedi Alz's user avatar
0 votes
1 answer
87 views

I am extracting each full row of a csv file using std::getline: for (std::string row; std::getline(is, row); ) // reads entire row in csv file { if (std::ranges::count(row, ',') != Temp_reading::...
a_floating_point's user avatar
1 vote
2 answers
126 views

Why does std::istream::seekg() affect the behavior of std::istreambuf_iterator? I carefully read the introduction about std::istreambuf_iterator on cppreference, but there is no direct answer for this ...
John's user avatar
  • 3,574
0 votes
2 answers
91 views

The code: #include<iostream> #include<vector> #include<numeric> using namespace std; class Point{ double m_x,m_y; public: Point(double x=0,double y=0):m_x(x),m_y(y){} Point ...
Cat Ball's user avatar
1 vote
0 answers
42 views

In the following code: std::string fn() { std::ifstream ifs {"bob", std::ios::in | std::ios::binary}; auto beg = std::istreambuf_iterator<char>(ifs); auto end = std::...
code_fodder's user avatar
  • 16.6k
0 votes
1 answer
54 views

I created a C++ program that uses a method of a library. This method needs an istream to work. The C++ compiled program is executed using child_process module of NodeJS and the file is sent to the c++ ...
AlbertDeTerre's user avatar
0 votes
0 answers
23 views

enter image description here i tried to used operator istream and ostream but it doesn't work. I'm writing a HinhTron class from the existing Diem2D class to use point coordinates from the 2D class. ...
bazzi's user avatar
  • 1
0 votes
1 answer
111 views

I was checking the implementation of the basic_istream class. I found the implementation at https://gcc.gnu.org/onlinedocs/gcc-13.2.0/libstdc++/api/a00113_source.html#l00095. Let me add a snippet. I ...
Hardik's user avatar
  • 187

15 30 50 per page
1
2 3 4 5
48