41 Topics

Member Avatar for
Member Avatar for saadahkh

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. …

Member Avatar for WaltP
0
510
Member Avatar for Firo

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 …

Member Avatar for Fbody
0
177
Member Avatar for baldwindc

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 …

Member Avatar for arkoenig
0
1K
Member Avatar for newbyE

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? …

Member Avatar for newbyE
0
7K
Member Avatar for Alexkid

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 …

Member Avatar for Ancient Dragon
0
194
Member Avatar for fire_

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 …

Member Avatar for Ancient Dragon
0
271
Member Avatar for neuelen

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 …

Member Avatar for neuelen
0
102
Member Avatar for corby

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 …

Member Avatar for corby
0
104
Member Avatar for Alexia Ooi

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 ========== …

Member Avatar for Salem
0
146
Member Avatar for sreejithbabu

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 …

Member Avatar for sreejithbabu
-1
865
Member Avatar for Ancient Dragon

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 …

Member Avatar for majestic0110
0
10K

The End.