Click here to Skip to main content
15,918,404 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: CPP Syntax Pin
CPallini28-Sep-17 22:16
mveCPallini28-Sep-17 22:16 
GeneralRe: CPP Syntax Pin
Bram van Kampen6-Oct-17 13:51
Bram van Kampen6-Oct-17 13:51 
QuestionComparing Files for Differences Pin
Member 1343302227-Sep-17 3:42
Member 1343302227-Sep-17 3:42 
AnswerRe: Comparing Files for Differences Pin
jeron127-Sep-17 4:09
jeron127-Sep-17 4:09 
QuestionRe: Comparing Files for Differences Pin
David Crow27-Sep-17 5:24
David Crow27-Sep-17 5:24 
AnswerRe: Comparing Files for Differences Pin
jschell27-Sep-17 9:23
jschell27-Sep-17 9:23 
GeneralRe: Comparing Files for Differences Pin
Member 1343302228-Sep-17 2:41
Member 1343302228-Sep-17 2:41 
GeneralRe: Comparing Files for Differences Pin
Jochen Arndt28-Sep-17 3:29
professionalJochen Arndt28-Sep-17 3: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 4:00
Member 1343302229-Sep-17 4:00 
GeneralRe: Comparing Files for Differences Pin
jeron129-Sep-17 4:47
jeron129-Sep-17 4:47 
GeneralRe: Comparing Files for Differences Pin
Jochen Arndt29-Sep-17 4:58
professionalJochen Arndt29-Sep-17 4:58 
GeneralRe: Comparing Files for Differences Pin
jschell29-Sep-17 6:57
jschell29-Sep-17 6:57 
AnswerRe: Comparing Files for Differences Pin
Joe Woodbury29-Sep-17 13:04
professionalJoe Woodbury29-Sep-17 13:04 
AnswerRe: Comparing Files for Differences Pin
User 5838523-Oct-17 7:28
User 5838523-Oct-17 7:28 
Questionsend notification to srvice Pin
john563226-Sep-17 23:05
john563226-Sep-17 23:05 
AnswerRe: send notification to srvice Pin
CPallini26-Sep-17 23:25
mveCPallini26-Sep-17 23:25 
QuestionTo create drag and drop graphics builder Pin
manoharbalu25-Sep-17 21:05
manoharbalu25-Sep-17 21:05 
AnswerRe: To create drag and drop graphics builder Pin
Richard MacCutchan25-Sep-17 21:19
mveRichard MacCutchan25-Sep-17 21:19 
GeneralRe: To create drag and drop graphics builder Pin
manoharbalu25-Sep-17 22:26
manoharbalu25-Sep-17 22:26 
GeneralRe: To create drag and drop graphics builder Pin
Richard MacCutchan25-Sep-17 22:30
mveRichard MacCutchan25-Sep-17 22:30 
QuestionHelp with no default constructor message Pin
ForNow23-Sep-17 19:03
ForNow23-Sep-17 19:03 
AnswerRe: Help with no default constructor message Pin
Richard MacCutchan23-Sep-17 21:06
mveRichard MacCutchan23-Sep-17 21:06 
GeneralRe: Help with no default constructor message Pin
ForNow24-Sep-17 3:52
ForNow24-Sep-17 3:52 
GeneralRe: Help with no default constructor message Pin
Richard MacCutchan24-Sep-17 4:00
mveRichard MacCutchan24-Sep-17 4:00 
GeneralRe: Help with no default constructor message Pin
ForNow24-Sep-17 4:12
ForNow24-Sep-17 4: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.