Click here to Skip to main content
15,499,289 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: CPP Syntax Pin
CPallini28-Sep-17 23:16
mveCPallini28-Sep-17 23:16 
GeneralRe: CPP Syntax Pin
Bram van Kampen6-Oct-17 14:51
MemberBram van Kampen6-Oct-17 14:51 
QuestionComparing Files for Differences Pin
Member 1343302227-Sep-17 4:42
MemberMember 1343302227-Sep-17 4:42 
AnswerRe: Comparing Files for Differences Pin
jeron127-Sep-17 5:09
Memberjeron127-Sep-17 5:09 
QuestionRe: Comparing Files for Differences Pin
David Crow27-Sep-17 6:24
MemberDavid Crow27-Sep-17 6:24 
AnswerRe: Comparing Files for Differences Pin
jschell27-Sep-17 10:23
Memberjschell27-Sep-17 10:23 
GeneralRe: Comparing Files for Differences Pin
Member 1343302228-Sep-17 3:41
MemberMember 1343302228-Sep-17 3:41 
GeneralRe: Comparing Files for Differences Pin
Jochen Arndt28-Sep-17 4:29
professionalJochen Arndt28-Sep-17 4:29 
Member 13433022 wrote:
regardless of the order in which those paragraphs are placed in the two different files

With that requirement I don't know any existing tool because those usually try to find the next identical sequence.

But writing such a tool for your requirement is not very difficult:

  • Read file 2 completely into allocated memory (one more byte to append a NULL char)
  • Count the number of lines (number of LF chars)
  • Allocate a buffer for char* pointers to hold the pointers to the beginning of each line
  • Fill the line pointer buffer (search for next LF and store address plus one)
  • Read file 1 line by line and check if that line matches any line from the file 2 buffer
  • If there is no match, write the line to file 3

GeneralMessage Closed Pin
29-Sep-17 5:00
MemberMember 1343302229-Sep-17 5:00 
GeneralRe: Comparing Files for Differences Pin
jeron129-Sep-17 5:47
Memberjeron129-Sep-17 5:47 
GeneralRe: Comparing Files for Differences Pin
Jochen Arndt29-Sep-17 5:58
professionalJochen Arndt29-Sep-17 5:58 
GeneralRe: Comparing Files for Differences Pin
jschell29-Sep-17 7:57
Memberjschell29-Sep-17 7:57 
AnswerRe: Comparing Files for Differences Pin
Joe Woodbury29-Sep-17 14:04
professionalJoe Woodbury29-Sep-17 14:04 
AnswerRe: Comparing Files for Differences Pin
User 5838523-Oct-17 8:28
MemberUser 5838523-Oct-17 8:28 
Questionsend notification to srvice Pin
john563227-Sep-17 0:05
Memberjohn563227-Sep-17 0:05 
AnswerRe: send notification to srvice Pin
CPallini27-Sep-17 0:25
mveCPallini27-Sep-17 0:25 
QuestionTo create drag and drop graphics builder Pin
manoharbalu25-Sep-17 22:05
Membermanoharbalu25-Sep-17 22:05 
AnswerRe: To create drag and drop graphics builder Pin
Richard MacCutchan25-Sep-17 22:19
mveRichard MacCutchan25-Sep-17 22:19 
GeneralRe: To create drag and drop graphics builder Pin
manoharbalu25-Sep-17 23:26
Membermanoharbalu25-Sep-17 23:26 
GeneralRe: To create drag and drop graphics builder Pin
Richard MacCutchan25-Sep-17 23:30
mveRichard MacCutchan25-Sep-17 23:30 
QuestionHelp with no default constructor message Pin
ForNow23-Sep-17 20:03
MemberForNow23-Sep-17 20:03 
AnswerRe: Help with no default constructor message Pin
Richard MacCutchan23-Sep-17 22:06
mveRichard MacCutchan23-Sep-17 22:06 
GeneralRe: Help with no default constructor message Pin
ForNow24-Sep-17 4:52
MemberForNow24-Sep-17 4:52 
GeneralRe: Help with no default constructor message Pin
Richard MacCutchan24-Sep-17 5:00
mveRichard MacCutchan24-Sep-17 5:00 
GeneralRe: Help with no default constructor message Pin
ForNow24-Sep-17 5:12
MemberForNow24-Sep-17 5:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.