Questions tagged [sstream]
111 questions
-1
votes
1 answer
Can't output my whole file, premature exit by inputFile.eof()
if(inputFile.is_open()){
while(!inputFile.eof()){
getline(inputFile, line);
ss << line;
while(ss){
ss >> key;
cout << key << " ";
…

Edany416
- 49
- 6
-2
votes
1 answer
Can't convert char to string with stringstream C++
I'm just gonna warn you all that my code contains small bits of french and english here and there so if you don't understand a variable or something please do ask and consider it as a free French class haha. Okay so I have a project which consists…

Fares
- 893
- 1
- 11
- 24
-2
votes
1 answer
Implementing a single class with different set of arguments
I am working on a data parser for a project. I have to parse a file that may contain two different types of objects:
Type-1:
sb0 hardrectilinear 4 (0, 0) (0, 82) (199, 82) (199, 0)
Type-1 has to be stored as a class block, with the following…

Vignesh Shriram
- 7
- 1
-2
votes
1 answer
Why won't this piece of my code write to file
I am developing a C++ banking system.
I am able to get the float, newbal, values correctly and when I try to write to file, there is no data in the file.
else if (x == 2)
{
cout << "You have selected option number 2. Deposit.\n";
cout <<…

user2934783
- 13
- 4
-3
votes
2 answers
Concatenating variables in c++
my problem goes like this:
Let's suppose i got 3 variables (i = 1, j = 2, k =3)
I want to do this: "a = 0.ijk" so a == 0.123
But those variables are under multiple for's so i'm saving their value on array..
I tried using sstream to convert them…

José Olívio
- 1
- 1
-6
votes
1 answer
Understanding stringstream
I have never used stringstream before and was given a sample code but with no explanation of what was happening in the code. If someone could explain each line's purpose that would be great. I have looked in multiple places but cant seem to pin down…

Spencer
- 1
- 2