does abyone know get_csv() and how to implement a string with get_csv()
  thanks
  bob
   
   #include<iostream>
  #include<vector>
  using namespace std; 
  int get_csv() {
          string string1;
          // repeat until EOF or comma
          // read characters
          // if not comma or readline, append to string
          cin.eof << "Enter a series of characters:  ";
          return string;
  }
   
  int main()
  {
  }
   
    Write a function get_csv() which gets a comma-separated string
  from the keyboard including whitespace except for '\n' characters.  In other
  words, if you call this function and type   Happy      Valentine's Day,
  it will return the string "   Happy      Valentine's Day" without the comma or
  newlines.  Write a main function which repeatedly (until end-of-file) asks 
the 
  user to enter a string followed by a comma, calls get_csv(), and prints out 
the
  string it returns.  Note: To read whitespace so you can decide whether to add 
  it to the string or ignore it, use
   
              char c;
              cin.get(c);
   
  This will read the next character whether whitespace or not.  If the cin fails
  (for example, if the user type Ctrl-Z or Ctrl-D for end-of-file), then 
get_csv()
  should return an empty string ("").  Name your program csv.cpp.  Hint: First
  write what you want the program to do as comment (//) lines in English (and 
  maybe have your TA look at it), and then write C++ code to do it.
   
   
  Write a function get_csv() which gets a comma-separated string
  from the keyboard including whitespace except for '\n' characters.  In other
  words, if you call this function and type
     Happy      Valentine's Day,
  it will return the string "   Happy      Valentine's Day" without the comma or
  newlines.  Write a main function which repeatedly (until end-of-file) asks 
the 
  user to enter a string followed by a comma, calls get_csv(), and prints out 
the
  string it returns.  Note: To read whitespace so you can decide whether to add 
  it to the string or ignore it, use    char c;             cin.get(c);
  This will read the next character whether whitespace or not.  If the cin fails
  (for example, if the user type Ctrl-Z or Ctrl-D for end-of-file), then 
get_csv()
  should return an empty string ("").  Name your program csv.cpp.  Hint: First
  write what you want the program to do as comment (//) lines in English (and 
  maybe have your TA look at it), and then write C++ code to do it.

       
---------------------------------
Never miss a thing.   Make Yahoo your homepage.

[Non-text portions of this message have been removed]

Reply via email to