josiftepe

Untitled

Dec 31st, 2020
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.48 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. #include <ctype.h>
  5. #define MAX 1000
  6. int main() {
  7.     FILE *p = fopen("vlez.txt", "r"); // ke citam od datoteka
  8.     if(p == NULL) {
  9.         printf("Ne moze da se otvori ovaa datoteka\n");
  10.         return 0; // zavrsi ja programata
  11.     }
  12.     char c;
  13.     while((c = fgetc(p)) != EOF) { // END OF FILE
  14.         // ako karakterot vrati EOF vo toj slucaj go zavrsuvame ovoj ciklus
  15.         printf("%c", c);
  16.        
  17.     }
  18.  
  19. }
  20.  
Advertisement
Add Comment
Please, Sign In to add comment