#include <stdio.h>
      
      int readAllContent() {
        FILE* fp = fopen("abc.txt", "r");
        fseek(fp, 0, SEEK_END);
        long size = ftell(fp);
        fseek(fp, 0, SEEK_SET);
        char* fcontent = (char*)malloc(size);
        fread(fcontent, 1, size, fp);
        fclose(fp);
        printf("%s\n", fcontent);
        return 0;
      }
      

      C language logoRead all content

      Codiga's C Recipes

      Read all content from a text file

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.