Logo 
Search:

C Programming Answers

Ask Question   UnAnswered
Home » Forum » C Programming       RSS Feeds
  Question Asked By: Elizabeth Yeboah   on May 13 In C Programming Category.

  
Question Answered By: Abhishek Singh   on May 13


/character by charecter adding./

#include<conio.h>
void add()
{
FILE *p;
p=fopen("asd.txt","a");
char c;
c=gatchar();
while(c!=EOF)
{
fputc(c,p);
c=getchar();
}
fclose(p);
}
void main()
{
FILE *p;
add();
p=fopen("asd.txt","w+");
c=fgetc(p);
while(!feof(p))
{
printf("%c",c);
c=fgetc(p);
}
fclose(p);
getch();
}

Share: 

 
 
Didn't find what you were looking for? Find more on program codes Or get search suggestion and latest updates.


Tagged: