Hello everybody i m using visual studio 2012.....in below code i m writing data in to a test.txt file but i dont know with which key file stop accepting char...i tried ctrl+z and ctrl+d but not working plzz help meee....
Code:#include<stdio.h> #include<conio.h> main() { char ch; FILE *ptr; ptr=fopen("test.txt","w"); printf("enter data for file\n"); while((ch=getchar())!=EOF) { fputc(ch,ptr); } fclose(ptr); getch(); }