topical media & game development

talk show tell print

professional-program-14-Getline-Getline.c

? / professional-program-14-Getline-Getline.c


  include <iostream>
  include <string>
  
  using namespace std;
  
  const int kBufferSize = 1024;
  
  int main(int argc, char** argv)
  {
    char buffer[kBufferSize + 1];
    cin.getline(buffer, kBufferSize);
  
    cout << "***" << buffer << "***" << endl;
  
    string myString;
    std::getline(cin, myString);
  
    cout << "***" << myString << "***" << endl;
  }
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.