Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <stdlib.h>
  4.  
  5. int main(void)
  6. {
  7. FILE *myFile;
  8. myFile = fopen("../map1.map", "r");
  9. if (myFile == NULL){
  10. printf("Couldn't open file.n");
  11. exit(-1);
  12. }
  13.  
  14. char buffer[10];
  15.  
  16. if (fscanf(myFile, "%10s", buffer) != 1){
  17. printf("The file is not formated correctly.n");;
  18. fclose(myFile);
  19. exit(-1);
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement