#include <stdio.h>
#include <stdlib.h>
int main()
{
FILE *fp;
char ch;
fp=fopen("exp.txt","w");
while( (ch=getchar()) !=EOF)
{
putc(ch,fp);
}
fclose(fp);
return 0;
}
I am using gcc compiler in linux mint
This code is not working only exp.txt is created which is empty.