// Justin C. Miller
// University of Wisconsin Oshkosh
// Made for: http://www.geocities.com/neonprimetime.geo/index.html
// Date: 2001
// Borland Builder 4.0

// cin.getline()
#include 
#include 
// there are 2 ways to call cin.getline()
// you can have 2 agruments or three
// cin.getline( YOUR_CSTRING, LENGTH )
// or
// cin.getline( YOUR_CSTRING, LENGTH, TERMINATING_CHARACTER )

int main()
{
        char name[30] ;

        cout << "Please enter your full name:" << endl ;
        cin >> name ;  // cin  stops reading in when it sees blank space
        cout << "Using cin:" << name << endl ;

        char dummy[30] ;
        cin.getline(dummy, 30) ; // catches what cin didn't grab it

        cout << "Please enter your full name:" << endl ;
        cin.getline(name, 20); // this will read in up to 20 characters
          // stopping only when you hit the enter button
          // getline WILL READ THE BLANK SPACES
        cout << "Using cin.getline:" << name << endl ;

        cout << "Please enter your full name:" << endl ;
        cin.getline(name, 20, '.') ; // this will read in up to 20 characters
          // stopping only when you it reads in a '.'
        cout << "Using cin.getline, stopping at '.' :" << name << endl ;


        getch() ;
        return 0 ;
}

// Output is as follows...
//
// Please Enter Your Full Name:
// Justin C. Miller                    - this is what i entered in
// Using cin:  Justin                  - notice it stopped when it hit a BLANK
// Please Enter Your Full Name:
// Justin C. Miller                    - this is what i entered in
// Using cin.getline(): Justin C. Miller      - this read in everything
// Please Enter Your Full Name:
// Justin C. Miller                    - this is what i entered in
// Using cin.getline(), stopping at '.' : Justin C      -notice is stopped at '.'

    Source: geocities.com/neonprimetime.geo/cpp/cpp_SourceCode

               ( geocities.com/neonprimetime.geo/cpp)                   ( geocities.com/neonprimetime.geo)