php hit counter

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
STL Input Stream Iterator in c++ 2011
VU Help • House Banner VU Help Virtual University Students - Assignments, Solved Papers, GDB & Exam Help Student Help Forum • Collaborative • Free Support
#1
STL Input Stream Iterator in c++ 2011

Code:
// A simple word counting program #include <iostream> #include <iomanip> #include <string> #include <map> #include <iterator> using std::cout; using std::cin; using std::endl; using std::string; int main() { std::map<string, int> words; // Map to store words and word counts cout << "Enter some text and press Enter followed by Ctrl+Z then Enter to end:" << endl << endl; std::istream_iterator<string> begin(cin); // Stream iterator std::istream_iterator<string> end; // End stream iterator while(begin != end ) // Iterate over words in the stream words[*begin++]++; // Increment and store a word count // Output the words and their counts cout << endl << "Here are the word counts for the text you entered:" << endl; for(auto iter = words.begin() ; iter != words.end() ; ++iter) cout << std::setw(5) << iter->second << " " << iter->first << endl; return 0; }

0300-9520262
Get solution in 24 hour
|cpmputer & internetConfusedmileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  i take input from getchar(); function in program in C++ 2012 Vuhelper 0 3,053 05-31-2012, 01:40 AM
Last Post: Vuhelper
  array project code c++ 2011 Vuhelper 0 1,320 12-10-2011, 06:32 PM
Last Post: Vuhelper
  factorial in C++ code 2011 Vuhelper 0 992 12-10-2011, 06:31 PM
Last Post: Vuhelper
  stack during function call in C++ 2011 Vuhelper 0 2,068 11-05-2011, 05:05 PM
Last Post: Vuhelper
  What is the Thing Queue? in c++ 2011 Vuhelper 0 1,822 11-05-2011, 05:02 PM
Last Post: Vuhelper
  ASCII to char conversion code in C++ 2011 Vuhelper 0 1,765 11-05-2011, 05:01 PM
Last Post: Vuhelper
  How to write a summation in a sequence? C++ 2011-12 Vuhelper 2 1,412 09-19-2011, 04:53 AM
Last Post: Xpert
  GetPixel problem in c++ 2011-12 Vuhelper 0 2,542 09-18-2011, 07:12 PM
Last Post: Vuhelper
  C++ with loop code 2011-12 Vuhelper 0 1,024 09-18-2011, 07:09 PM
Last Post: Vuhelper
  how can i read the last letter of a input file? 2011 Vuhelper 0 1,866 09-12-2011, 10:24 PM
Last Post: Vuhelper

Forum Jump:


Users browsing this thread: 1 Guest(s)
VU Help • House Banner VU Help Virtual University Students - Assignments, Solved Papers, GDB & Exam Help Student Help Forum • Collaborative • Free Support