Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <iostream>
- #include <string>
- #include <sstream>
- #include <cstdlib>
- upis u txt fajl
- ofstream myfile;
- myfile.open ("data.txt");
- for ( int i = 1; i <= 5; ++i )
- myfile << i << "\n";
- myfile.close();
- citanje iz txt fajla
- string line;
- ifstream myfile( "file.txt" );
- while(getline(myfile,line)){
- //do something with the line
- }
Advertisement
Add Comment
Please, Sign In to add comment