Friday, April 17, 2009

FPUTFSGE

#include
#include
void main()
{
FILE *fp;
char text[50];
int i=0;
clrscr();
fp=fopen("fget1.txt","a+");
if(fp==NULL)
{
printf("File not found\n");
exit(0);
}
printf("Enter Text here\n");
/*scanf("%s",text);*/
gets(text);

fputs(text,fp);
rewind(fp);
printf("Ur file contains....\n");
if(fgets(text,50,fp)!=NULL)
/*
while(text[i]!='\0')
{
putchar(text[i]);
i++;
} */
puts(text);
getch();
}

No comments: