Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <fstream>
- #include <iostream>
- #include <string>
- static void func1(const char *s);
- unsigned int HashLy(const char * str)
- {
- unsigned int hash = 0;
- for(; *str; str++)
- hash = (hash * 1664525) + (unsigned char)(*str) + 1013904223;
- return hash;
- }
- int main() {
- std::string filename("lalkalalka.txt");
- std::ofstream f_out(filename);
- f_out << "aaabbb";
- setlocale(LC_ALL,"rus");
- std::ifstream f_in(filename);
- uint i1(0);\
- std::string ssss("");
- std::getline(f_in,ssss);
- std::cout << ssss << std::endl;
- if (!f_in.is_open()){
- std::cout << "error" << std::endl;
- } else {
- for (std::string line; std::getline(f_in, line); )
- {
- std::cout << line << std::endl;
- i1 = HashLy(filename.c_str());
- std::cout << i1 << std::endl;
- }
- }
- std::cout << "fsd";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement