--- Robert Ryan <[EMAIL PROTECTED]> wrote:
> I got this to compile, but without producing
> anything with ./a.out
>
> #include<iostream>
> using namespace std;
> string get_csv()
> {
> char tmp; // set up a temporary char
> string string1; // create the string
> // repeat until EOF or comma
> // read characters
> // if not comma or readline, append to
> string
> // cin.eof << "Enter a series of characters:
> ";
> while(cin.get(tmp))
> {
> if(tmp != ',' && tmp != '\n')
> string1.push_back(tmp); //
> add to the string
> if(tmp == cin.eof())
> return " ";
> else if (tmp == ',')
> break;
> }
> return string1;
> }
> int main(int argc, char *argv[])
> {
> string string1;
> while (true)
> {
> string1 = get_csv();
> if (string1 == " ")
> break;
> cout << string1 << "\t";
> }
> system("Pause");
> return EXIT_SUCCESS;
> }
>
>
>
I get output - seems ok - it strips off the comma.
Mickey M.
Construction Partner Inc.
http://www.constructionpartner.com
____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs