Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.75 KB | None | 0 0
  1.  
  2. #include <string>
  3. #include <iostream>
  4. #include <fstream>
  5.  
  6. class Charac
  7. {
  8. public:
  9.     Charac(const std::string& fileName);
  10.  
  11. private:
  12.     bool    _cara[20][20];
  13.     char    _corresNumber;
  14.     char    _foundNumber;
  15. };
  16.  
  17. Charac::Charac(const std::string& fiN)
  18. {
  19.     std::ifstream st;
  20.  
  21.     std::cout << "fname: " << fiN << std::endl;
  22.     st.open(fiN.c_str());
  23.     std::cout << "file: " << st.is_open() << "fname: " << fiN << std::endl;
  24.     for (int i = 0; i < 20; i++) {
  25.         std::string read;
  26.        
  27.         st.width(20);
  28.         st >> read;
  29.         for (int j = 0; j < 20 && j < read.size(); j++) {
  30.             this->_cara[i][j] = (read[j] == '0');
  31.         }
  32.     }
  33.     st.close();
  34. }
  35.  
  36. int main() {
  37.     Charac      testChar0(std::string("C:/Users/Exanis/Documents/Visual Studio 2008/Projects/gaea/Release/txt/0.txt"));
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement