Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
1 vote
1 answer
104 views

#include <iostream> #include <fstream> #include <sstream> int main() { std::ifstream file("data.txt"); std::string line, numStr; // read first line std:...
Mathieu's user avatar
  • 332
0 votes
0 answers
52 views

char sDateAndTime[80]; time_t t; t = 1643873040; tm *timeinfo = localtime( &t ); strftime( sDateAndTime, 80, "%d/%m/%Y, %H:%M:%S", timeinfo ); std::cout << sDateAndTime; i have ...
-2 votes
1 answer
86 views

I am attempting to write a program that reads a file line by line, and storing the contents of each line as individual integer values. A typical line might look like this: 7190007400050083 The ...
0 votes
2 answers
145 views

I am trying to read all the numbers a line of text, one by one. Here is a minimal reproducible example of my code: #include <iostream> #include <sstream> int main() { std::string line ...
-1 votes
1 answer
116 views

so i have a small issue. I am working on a school assignment and i just can't figure out how to get the solution. So the assignment needs me to read a file in binary form and then find certain bit ...
1 vote
1 answer
57 views

I am testing a serialization code below, which fails for a few numbers. Any idea? #include <iostream> #include <sstream> int main() { std::stringstream ss; for (unsigned int m = 0; ...
3 votes
2 answers
914 views

Create a new empty C++ Windows console application in Visual Studio 2022. Add a "main.cppm" file and populate it with this: import <sstream>; int main() { std::stringstream ss; ...
0 votes
1 answer
631 views

I'm trying to print some data that I received as a string and for that I'm using the following function (FechaProg definition after the function) uint8_t Extrae_Data(string trama, FechaProg* destino ,...
vram's user avatar
  • 103
0 votes
1 answer
81 views

int integers; std::list<int> integersList = {}; string token; while(iss >> token) { if(stringstream(token) >> integers) { integersList.push_back(integers); } } ...
0 votes
0 answers
198 views

Let's say we have: void print(std::ostream &o) { o << "Hello World!"; } and: int main() { std::stringstream ss; ss << print(std::cout); // does not work std::...
0 votes
1 answer
152 views

How do I read in a file and ignore nonintegers? I have the part down where I remove the ',' from the file, but also need to remove the first word as well. #include <iostream> #include <...
0 votes
3 answers
396 views

I have an issue that I haven't been able to find a good way to solve, mostly because I am relatively new to C++, but not new to programming. I have a file with several lines in it, one of them being: ...
Brent Mayes's user avatar
1 vote
1 answer
761 views

I have a text file structured like this: 6 0,2,0,0,5,0 3,0,4,0,0,0 0,0,0,6,1,0 0,0,0,0,2,0 0,0,0,0,2,4 1,0,0,0,0,0 0,5 The first number represents the number of vertices and the 2D matrix is an ...
0 votes
2 answers
361 views

So I am a CS student working on a project for exception handling (Try/catch). My teacher told us to implement the sstream library so we could use it in a class that outputs a message that includes a ...
0 votes
0 answers
179 views

I am trying to read a list of complex numbers from a txt file given as: 3+5i 2-3i 11+22i However when i use stringstream(oneline)>>real>>plusorminus>>im>>ichar; the real part ...

15 30 50 per page
1
2 3 4 5
...
8

AltStyle によって変換されたページ (->オリジナル) /