473,387 Members | 1,545 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,387 software developers and data experts.

String trouble

I'm need my program to read the entire first line from a program. and then write it to an output file.

ex: Men's Track Meet

thus far i can only get it to read Men's

this is using the C++ language

thanks
Nov 5 '06 #1
4 1100
dav3
94
try using getline(). I recently encountered a similar situation. getline() worked perfectly.
Nov 5 '06 #2
Thanks worked perfectly, but i've got another problem.

Sample input:

Men's track Results
===============================================
1999 Danbury 30 Trinity Catholic 35
2000 Ridgefield 80 Staples High School 50


I want my program to read the year, and then the names of the schools and ignore the scores. The trouble i'm having is with the names of the schools being more then one word.

thanks again
Nov 6 '06 #3
dav3
94
the only thing i can think of at the moment is ignore(). But I am not sure if you can use that because you want to keep the year..
Nov 6 '06 #4
okay i want to keep the scores as well, but the problem is i'm having trouble with schools whose name is longer then one word.
Nov 6 '06 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

108
by: Bryan Olson | last post by:
The Python slice type has one method 'indices', and reportedly: This method takes a single integer argument /length/ and computes information about the extended slice that the slice object would...
6
by: Mark | last post by:
Hi, My page has a table with many columns such that the right-side of the table gets chopped off when printed. I specify a table width of 100%, but otherwise no cell dimensions are specified. ...
1
by: Hai Ly Hoang | last post by:
Hi, I have string which contains linefeed and carry-return characters (eg. "Banana \r\n Apple \r\n..."); To print this string, i make use of PrintPage event of PrintDocument with DrawString...
9
by: Fei Liu | last post by:
In Accellerated C++, the author recommends that in a header file one should not declare using std::string, using std::vector etc instead one should directly specify the namespace specifier in...
3
by: Wyz | last post by:
Hello. I have troubles giving me a big headache, I hope somebody may help me. I'm using Indy.Sockets to have FTP support for my VB.NET application (I also tried with another dll made in C# but the...
14
by: Josh Baltzell | last post by:
I am having a lot more trouble with this than I thought I would. Here is what I want to do in pseudocode. Open c:\some.pdf Replace "Replace this" with "Replaced!" Save c:\some_edited.pdf I...
19
by: VK | last post by:
http://groups.google.com/group/comp.lang.javascript/browse_frm/thread/ b495b4898808fde0> is more than one month old - this may pose problem for posting over some news servers. This is why I'm...
2
by: jenniamia | last post by:
I need to make the string "myFile" into a byte and then put it in the database as a file/image, where later it needs to be pulled out and back into a string from the byte. I'm really having trouble...
3
blackstormdragon
by: blackstormdragon | last post by:
My trouble causing lines are maked within the code. #include<iostream> #include<string> using namespace std; void main() { string* head; string* tail;
21
by: yogicoder | last post by:
following is the code to accept a string from user, but i get segmentation fault as soon i have finished entering the string i.e. as soon as i press the 'enter' key. #include <stdio.h>...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.