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?
solaf_111
0
Newbie Poster
Recommended Answers
Jump to Postyes, 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() …
All 3 Replies
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
solaf_111
0
Newbie Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
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.