and, if the second file have one same row in first file, write a "*" into the same row (begining) in the first file .just this,but it doesn't work.i want to learn it,but now i know c very little,so.....
can you tell me some,thanks!!really!!!big thank!

Why can't you compare the line1==line2 way? Because line1 and line2 are in fact pointers, adress numbers and they wont ever be the same unless they point the same thing.
strcmp() simply checks line1[i]==line2[i] for all possible i and if all them match you get a zero, that's why there is a !strcmp().

o,ok,
output only one row:
¡ï2,2,1¡ï->: 4567456
----------
but if cut off this line: "fputc('*',fp1);"
the output will be :
¡ï2,2,1¡ï->: 4567456
¡ï3,3,2¡ï->: lkhjlhjklhjklhjklsrq fsdrf
¡ï4,6,3¡ï->: ghkjghj
¡ï5,7,4¡ï->: dfgsdfgsdfgdfgdsfgdfg
----------
anything wrong?
but i want to write something into the same row'biginning in the first file. if i cut off "fputc('*',fp1);" it can compare the whole file but can't write anything,why when i add "fputc('*',fp1);" it doesn't work?
who can help me?thanks!!

I assume that you want to (prepend) append the "*" to the matching line in the file, don't you?
In that case that's a bit more complex, you have to open the file in update mode "+" option for fopen (not "w", because it truncates the file to 0 lenght, that's why you get only the *. Why does it stop after the first line? No idea, maybe there is some error, check the return value of fputc, is it eof?) Once the file is opened this way you'll have to find the position in the file where you want to write to, with fseek and so on (look stdio.h reference).
A solution would be to open a new file ("w" option) and write the line if it does not match and write "*"+line if it does match. Remember to include a "\n" character in the end of the lines so it jumps lines.
Hope this helps.