when i read from file1 then write to athor file2, file 1 writen on file 2 but if file 2 contain lines more than file 1 ,this lines stay in the file 2
don't empty the file2 then write on
is there any solove to this problem?

yes, but can't help you unless you post the code. Most likely its the way you opened file2. Look at this description of the second parameter. If you want to delete the previous contents of file2 then you have to add the ios::truncate flag in the open() method.

the link doesn't open

you are right -- I posted a crappy link. Here is the good link.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.