This is the simple and logic building C++ program to understand the string functions. The program counts the total number of words in a given string.
Source Code
#include "stdafx.h"
#include <iostream>
#include <sstream>
#include <string>
using namespace std;
int main()
{
cout<<"\a\n\n\n"
<<"\t******************************************************"<<endl
<<"\t** **"<<endl
<<"\t** Welcome To **"<<endl
<<"\t** **"<<endl
<<"\t** Count words **"<<endl
<<"\t** **"<<endl
<<"\t** Demo **"<<endl
<<"\t** **"<<endl
<<"\t******************************************************"<<endl<<endl<<endl;cout<<"";
string s("Somewhere down the road");
istringstream iss(s);
int wordCount=0;
do
{
string sub;
iss >> sub;
wordCount++;
} while (iss);
cout <<"Total words present in a givent string \""<<s<<"\" is : "<<wordCount-1<<endl;
system("pause");
return 0;
}
William Hill Casino - Ainsworth, MI
ReplyDeleteBook William Hill Casino - Ainsworth, MI in the best location betway login with the finest sports betting experience in the country, william hill William 더킹카지노 Hill online casino at
How to register a new bet365 account | Sportsbook - Airjordan 7
ReplyDeleteBet365 is cheap jordan 1 retro one of the best betting sites 토토커뮤니티 in 토토 사이트 the world when it comes to mobile betting. Authentic jordan 7 retro We'll show you how 올인 구조대 you can use the Bet365 app