Advertisement
evage

Untitled

Oct 11th, 2021
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <math.h>
  4.  
  5. using namespace std;
  6.  
  7. int main() {
  8.    
  9.     FILE* f;
  10.    
  11.     f = fopen("C:\\test.txt", "r");
  12.     if (!f) {
  13.         cout << "No such file directory";
  14.         return 1;
  15.     }
  16.     char c;
  17.     while ((c = getc(f)) != EOF) {
  18.         cout << c;
  19.     }
  20.     return 0;
  21. }
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement