Wednesday, November 28, 2012

Read & Write MODE R+ MODE usage in FILES using C language


#include<stdio.h>
#include<conio.h>
#include<process.h>
void main()
{
FILE *f;
char c;
clrscr();
f=fopen("balaram.txt","r+");
if(f==NULL)
{
 printf("File can not appending");
 exit(1);
}
printf("\n contents read");
while(!feof(f))
{
printf("%c",getc(f));
}
printf("write data and to stop press'.':");
while(c!='.')
{
c=getche();
 fputc(c,f);
}
}

No comments:

Post a Comment

DC motor control with Pulse Width Modulation Part 1

DC Motor intro DC motor is a device which converts electrical energy into kinetic energy. It converts the DC power into movement. The typica...