Create new file to write and then open it for read

#include<stdio.h>
main()
{
      FILE *f1;
      char c;
      printf("\nData input.\n");
      f1=fopen("Input","w");
      while((c=getchar())!=EOF)
      putc(c,f1);
      fclose(f1);
      printf("\nData output.\n");
      f1=fopen("Input","r");
      while((c=getc(f1))!=EOF)
      printf("%c",c);
      fclose(f1);
      getch();
}

Comments

Popular posts from this blog

Customize User's Profile in ASP.NET Identity System

Lambda two tables and three tables inner join code samples