Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <string>
- using namespace std;
- int main()
- {
- string contain_of_file,bufor,word,empty=" ",new_line="n";
- string conection;
- string::size_type position;
- cout<<"Give a word";
- cin>>word;
- ifstream NewFile;
- ofstream Nowy1;
- Nowy1.open("tekstpa.txt", ios::app);
- NewFile.open("plik1.txt");
- while(NewFile.good())
- {
- getline(NewFile, contain_of_file);
- cout<<contain_of_file;
- position=contain_of_file.find("Zuzia");
- if(position!=string::npos)
- {
- conection=contain_of_file+empty+word+new_line;
- Nowy1<<conection;
- }
- Nowy1<<contain_of_file;
- }
- Nowy1.close();
- NewFile.close();
- cin.get();
- return 0;
- }
- while (std::getline(NewFile, contain_of_file)) { ... }
- Nowy1 << contain_of_file << ' ' << word << 'n';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement