hi guys,
this code is working fine in taking entries from user and storing it in a file.. but my requirement is the request must be in a window of the specified size and the entry should also be taken in the window itself.. which inturn should get stored in the text file.
also if anybody would suggest me how would i specify the path for the file to be created.
#include <stdio.h>
#include <conio.h>
int main(void)
{
char buffer[BUFSIZ] = {127};
FILE *pFile;
char *p;
clrscr();
window(10,10,70,20);
pFile = fopen ("myfile.txt","wt");
if (pFile!=NULL)
{
cprintf("Enter a string \r\n");
p = cgets(buffer);
fputs(p,pFile);
fclose(pFile);
}
return 0;
}