473,399 Members | 4,177 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Getline delimiter

Is there a way to set the delimiter to the "enter" key? I've tried the
ASCII values for carriage return, line feed, form feed, and even null
but it doesn't work.
Thanks.
-==Kensu==-
Jul 19 '05 #1
2 9975
Chris Schumacher wrote:
Is there a way to set the delimiter to the "enter" key? I've tried the
ASCII values for carriage return,
I guess you mean newline here.
line feed, form feed, and even null but it doesn't work.


"doesn't work" is not a good description. Post a minimal, but complete
program that shows the behaviour you observe and describe what happens
instead of the expected.
The default delimeter for getline is newline, so it should actually work
if you don't explicitly provide one.

Jul 19 '05 #2
"Chris Schumacher" <ke*****@hotmail.com> wrote...
Is there a way to set the delimiter to the "enter" key? I've tried the
ASCII values for carriage return, line feed, form feed, and even null
but it doesn't work.


There is no such thing in C++ as <<"enter" key>>, so, no it is not
possible without going to some kind of platform-specific functionality.

If you explain what problem you're trying to solve, and post the code
that you think doesn't work, perhaps we'd be able to recommend some
solution.

Just a hunch: there is a version of the standard library out there in
which in order to get 'getline' to return you have to press "Enter"
twice. All you need is to find a better version of the standard
library, I guess.

Victor
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: JustSomeGuy | last post by:
Getline has a delimiter character parameter that is used to say when input should stop. (std::cin.getline) However what do you do if you have multiple conditions/character on which you wish to...
3
by: salvo | last post by:
Hi, I'm having some trouble in parsing a simple text file which is formatted as follows: .... string\tstring\tstring\n .... I tried to parse it with the following statments:
1
by: Chris Coleman | last post by:
Hi, As some background, I have implemented a new stream object to work with tcp socket streams. I derive a new socket stream from basic_streambuf. I then derive a my sream object from my...
18
by: Amadeus W. M. | last post by:
I'm trying to read a whole file as a single string, using the getline() function, as in the example below. I can't tell what I'm doing wrong. Tried g++ 3.2, 3.4 and 4.0. Thanks! #include...
4
by: MC felon | last post by:
getline isn't working..... what's wrong with this code? #include <iostream> #include <string> #include <conio2.h// ignore this.. my old habits class base { int x,y;
6
by: ankit.kumar.agarwal | last post by:
I am facing a problem with getline I am reading a text file with a getline function the lines can have '|' as separator. everything works OK but in case if i have 2 delimitors in file '234||...
3
by: JackC | last post by:
Hi, How do i use stringstreams getline function to extract lines from an existing string? Say i have: string strlist = "line1\r\nLine2\r\nLine3\r\n"; I want to extract each line out into a...
11
by: rory | last post by:
I am reading a binary file and I want to search it for a string. The only problem is that failbit gets set after only a few calls to getline() so it never reaches the end of the file where the...
5
by: barcaroller | last post by:
I have a text file with mixed carriage returns ('\n' and '\r\n'). On Linux, both the std::string getline() global function and the std::iostream getline() member function are keeping some of the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.