Untitled

Anonymous
plain_text
03/22/2024 1:52 AM
556 B
18
Indexable
#include <stdio.h>
#include <stdlib.h>

void main()
{
   FILE *fptr;
char ch[200];

   fptr=fopen("C:\Sudip_Dahal_File_Handling2","w");
   if(fptr==NULL){
    printf("File not opened !!!");
   exit(0);
   }

   else {
    printf("File opened successfully.");
   }

   //fputs("Hello!Sudip_Dahal",fptr);
   fgets(ch,2,fptr);

   printf("\nContent in the file is : %s",ch);
   fclose(fptr);
}

Editor is loading...
Leave a Comment