Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <fstream>
- using namespace std;
- int main() {
- ifstream in ("f1.txt");
- ofstream out("f2.txt");
- char c1 = '\0', c2 = '\0', seeker;
- cout << "Enter the seeker char: " << endl;
- cin >> seeker;
- while (in) {
- c1 = c2;
- in >> c2;
- if (c1 == seeker)
- out << c2;
- }
- in.close();
- out.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement