EmbLogic's Blog

This is a program to compare two text.

head    1.1;
access;
symbols;
locks; strict;
comment    @ * @;

1.1
date    2014.03.19.15.25.02;    author emblogic;    state Exp;
branches;
next    ;

desc
@This is a program to compare two text.
we have checked whether two files are identical or not with the help of function fopen and fgetc.
@

1.1
log
@Initial revision
@
text
@#include<stdio.h>
#include<string.h>
int main()
{
FILE *f1,*f2;
char ch1,ch2;
f1=fopen(“file5″,”r”);
f2=fopen(“file4″,”r”);
do
{
ch1=getc(f1);
ch2=getc(f2);
if(ch1==ch2)
{
if(ch1==10 && ch2==10)
printf(“both files are equal”);
}
else
{
printf(“files are not equal”);
break;
}
}
while(ch1!=10 && ch2!=10);
return 0;
}
@

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>