void GetData(fstream& In, string& Name, double& Acres, int& Jars);
/*Pre: The stream in is open for input.
Post: Returns the name of less than or equal 29 characters, acres and
number of jars.
*/

I am using this function to pull names from an infile.
The first line of the infile looks like this: Orville's Acres, 114.8 43801. All I want is the name with no comma and if another name in my infile has more than 29 characters, i want it to output the name, but with no more than 29 characters. I will need to use a loop (while) to read it until comma or 29 characters whichever comes first. I am trying to use cin.get() to read the name one character at a time.

I hope somebody can help me!

Thanks,

Troy

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.