>I have another problem I'm using two linked lists and I opened two files for each one but when I write list to file It writes both lists in the two files .
You are using c and m as two pointers to mark the two lists right? Thats the reason you are passing them.But why this?
c=head;
m=head;
by this you are making both c and m point to head so whats the use of passing them to the function ???
Well you have opened your files fpta and fptb in mode "w" write mode and so it would delete all the contents of it next time you open it and write fresh so have a look at it.