C++

Objectives :

  • File Name: getline_char_string1.cpp
    Accept a line as an input, can also be used to load the content of a text file.
  • String object can accept values from an character array.
  • Syntax of geline(---)
    istream& getline (char* s, streamsize n );
     
  • Code : getline_char_string1.txt
 

Step: 1 Create a source file.

Step: 2 Edit and save Source file

Step: 3 Runtime Views:

 

Step: Brief Discussion: