Structure of the Problem Requirements
Delimiter can be used as a end point in any string. Delimiters are also used in filing as a end point or in tokens (words). We can use any character as a delimiter . In getline function just pass the cin , string and your delimiter .Source Code
#include<iostream>
#include<string>
#include<stdio.h>
using namespace std;
int main ()
{
string story;
cout<<" \t \t Enter Your Story and End it with Fullstop.\n ";
getline(cin,story,'.');
cout<<endl<<endl ;
cout<<" \t \t \t \t Your Story \n \n "<<story<<endl;
}
Output of the Program
Asad Niazi is Software Engineer , Programmer, Web Developers and a young mentor of Tech Solutions Desk and Blogging Solutions . Asad Love to writes about Technology, Programming, Blogging and make money online.
0 comments:
Post a Comment