A
arnuld
i am not able to come up with any solution for this. i am not even
able to think of one line of code for this solution.
/* Strouostrup, 5.9, exercise 12
*
*
* STATEMENT:
* write a function that counts the number of occurrences of a pair of
* letters ina "string" and another that does the same in a zero-
terminated
* array fo char(a C style string). e.g. the pair "ab" appears twice in
* "xabaacbaxabb"
*
*/
#include<iostream>
#include<string>
int main()
{
std::string s, pair;
std::cout << "Enter a word: ";
std::cin >> s;
std::cout << "Enter a pair of letters or a single letter you want to
find in the word: ";
std::cin >> pair;
// that's ALL i can think of
able to think of one line of code for this solution.
/* Strouostrup, 5.9, exercise 12
*
*
* STATEMENT:
* write a function that counts the number of occurrences of a pair of
* letters ina "string" and another that does the same in a zero-
terminated
* array fo char(a C style string). e.g. the pair "ab" appears twice in
* "xabaacbaxabb"
*
*/
#include<iostream>
#include<string>
int main()
{
std::string s, pair;
std::cout << "Enter a word: ";
std::cin >> s;
std::cout << "Enter a pair of letters or a single letter you want to
find in the word: ";
std::cin >> pair;
// that's ALL i can think of