getline Questions

5

I'm trying to turn a cout command into a getline command in c++. This is my code that I'm trying to changes.... for (int count=0; count < numberOfEmployees; count++) { cout << "Name: "...
Wearable asked 3/2, 2012 at 6:29

2

Solved

My question is in reference to an assignment that I am working on. It seems like there are multiple ways to approach the assignment. The program I am writing will be a filter for text files. The ...
Flabbergast asked 10/12, 2011 at 23:13

1

Solved

This is my first time using stackoverflow. I've been unable to find out the information I need regarding getline. I'm in a simple programming class for engineering transfers so the code that we wri...
Carnarvon asked 23/11, 2011 at 19:51

5

i wrote an application which processes data on the GPU. Code works well, but i have the problem that the reading part of the input file (~3GB, text) is the bottleneck of my application. (The read f...
Meingolda asked 14/11, 2011 at 14:33

1

Solved

Is it possible use getline() to read a valid file without setting failbit? I would like to use failbit so that an exception is generated if the input file is not readable. The following code alway...
Habakkuk asked 21/10, 2011 at 20:59

2

Solved

Is an ANSI C-compliant implementation allowed to include additional types and functions in its standard library, beyond those enumerated by the standard? (An ideal answer would reference the releva...
Coreen asked 11/9, 2011 at 5:53

1

Solved

In the following code : #include <iostream> #include <fstream> #include <string> using namespace std; int main() { string x = "This is C++."; ofstream of("d:/tester.txt"); o...
Circumstantial asked 12/7, 2011 at 10:59

4

Solved

I face the challenge of reading/writing files (in Gigs) line by line. Reading many forum entries and sites (including a bunch of SO's), mmap was suggested as the fastest option to read/write file...
Vevina asked 11/7, 2011 at 21:29

3

Solved

Possible Duplicate: getline not asking for input? There is some unique thing happening in my program. Here are some set of commands : cout << "Enter the full name of student: ...
Garvy asked 11/7, 2011 at 12:7

3

Solved

This is probably a very simple problem but forgive me as I am new. Here is my code: #include <iostream> #include <string> #include <sstream> using namespace std; int main ...
Tompion asked 10/7, 2011 at 18:3

5

Solved

Hey, I'm trying to write a program that will accept new tasks from people, add it to a stack, be able to display the task, be able to save that stack to a text file, and then read the text fi...
Dialectics asked 2/2, 2011 at 16:22

5

Solved

What does the istream::getline method return? I am asking because I have seen that to loop through a file, it should be done like this: while ( file.getline( char*, int ) ) { // handle input } ...
Utmost asked 16/1, 2011 at 21:55

3

Solved

I'm curious about the technical reason for cin.getline and the global getline function being in different places. What was the motivation for not simply defining all these function signatures for ...
Doable asked 5/11, 2010 at 20:58

3

Solved

This is my main program, int main () { string command; cin>>command; if(command == "keyword") { string str, str2, str3, str4; cout << "Enter first name: "; getline (ci...
Parkins asked 1/11, 2010 at 7:32

2

Solved

This is a very strange problem, when my program asks the user for the address, instead of waiting for input, it seems to skip the getline() function completely Answerinput: cout << "w...
Firm asked 16/9, 2010 at 23:5

3

Solved

In C++ we can enter multiple lines by giving our own choice of delimiting character in the getline() function.. however I am not able to do the same in Python!! it has only raw_input() and sys.stdi...
Delineator asked 11/6, 2010 at 12:13

1

Solved

A common piece of code I use for simple string splitting looks like this: inline std::vector<std::string> split(const std::string &s, char delim) { std::vector<std::string> elems;...
Unfamiliar asked 1/4, 2010 at 19:3

3

Solved

I'm attempting to convert dates from one format to another: From e.g. "October 29, 2005" to 2005-10-29. I have a list of 625 dates. I use Awk. The conversion works -- most of the time. Hovewer, so...
Letters asked 6/3, 2010 at 3:46

1

Solved

I'm trying to use std:getline() but getting a strange runtime error: malloc: * error for object 0x10000a720: pointer being freed was not allocated * set a breakpoint in malloc_error_break to de...
Jacey asked 10/2, 2010 at 5:11

2

Solved

I have this code, int main() { std::string st; std::stringstream ss; ss<<"hej hej med dig"<<std::endl; std::getline(ss,st,' '); std::cout <<"ss.rdbuf()->str() : " <&l...
Tearjerker asked 7/4, 2009 at 21:51

4

Solved

I have a loop that reads each line in a file using getline(): istream is; string line; while (!getline(is, line).eof()) { // ... } I noticed that calling getline() like this also seems to work:...
Oxpecker asked 3/11, 2008 at 16:56

© 2022 - 2024 — McMap. All rights reserved.