41 Topics
|
|
Hi every body . iam writing a code that reads a line from input file and searches it in test file. but my getline() function reads only the first line and enters an infinite loop i have read many discussions on the topic but still unable to resolve the issue. … |
|
Mhm, so, the problem I'm having here is that, once the "while (!boatList.eof())" cycle reads the first line (EDIT: I meant, how should I put it, the first "segment"), it goes on infinite (?) loop reading the other one. [QUOTE]AX 777 Valtis 0 4 500 2007 5.5 -1 50.2 6 … |
|
I have been struggling with this for a while. Will someone please help me? The issue is within a while loop. The while loop is reading info from getline, copying values from an input file to (1)double array type char[i][20] , (2)array type double [i]. The input file is as … |
|
Hi, Please help... I am trying to read in a file in C++ and when I use getline I am not able to read in the last line when the last line in the input file does not have a newline (\n) at the end. How do I do this? … |
|
Hi there, ok, im fairly new to c++ and have been trying to figure this out for ages: I have a text file i want to read in that contains lines and lines of lat long points; N50 42.22 W002 55.33 N50 42.22 W002 55.33 N50 42.22 W002 55.33 i … |
|
Hello. I'm writing program wich reads from file line by line and then rewrites everything to other file. This is simplifyied part of code: [CODE]for (int i=0; i<=5;) { getline (file1, str1); /* file1 is file from wich i read and str1 is string*/ file << str1; }[/CODE] No i'm … |
|
Hello, I am coping a problem with getline. I have a txt file that looks like the following.And my task is to read it and put them in a file that contains 10 columns and not 8. [CODE=plain]0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,1 0,0,0,0,0,0,1,0 0,0,0,0,1,0,0,0 0,0,0,1,0,0,0,1 0,2,2,1,0,2,6,5 12,17,12,28,39,40,46,71 [/CODE] and I have to read … |
|
Ok so this is my code below in my member function definition .cpp file. The problem is when I execute the program it will not let me fill the answer for the first question so for example the output is: Please enter the name of the receiver: Please enter the … |
|
This is the program i'm trying to develop. It's not an assignment or anything. I'm just a newbie trying out new stuff. But I'm getting frustrated with this. [CODE]#include <iostream> using namespace std; //========== struct ========== struct nodeType { string song; int rating; nodeType *link; }; //------------------------------------------------------------------------------ //========== function ========== … |
|
The problem in this is that the program accepts a string with spaces [B]only for the first input[/B] and not for the rest of the inputs. It seems that getline only works for the first input. How can you make the vector store string with spaces (as elements of the … |
|
This is a simple example of how to delete a line from a text file. In order to do that you have to completely rewrite the file, leaving out the line(s) you want to delete. First open the input file, then open an output file (doesn't matter what filename you … |
The End.