![]() |
|
|||||||
|
|
Thread Tools | Search this Thread | Rate Thread |
|
#1
|
|||
|
|||
Locate similar words/phrases that are common to both filesheres the program description....
There exist two test files that are not identical with a size of between 100 and 250 characters. Write a c++ program that will read in these two text files, prompt the user for a length factor some value between 5 and 20 and locate similar (words phrases) that are common to both files. print the results of both files and similar words between them. HELP ME PLEASE... i know how to read from a text file but i dont know how to compare it.. thanks. |
|
#2
|
||||
|
||||
Re: c++ program..i need help please....Are the input files formatted in any certain way or is it just random words. That will make a difference. If they are just random words that you have to compare, then the only way I can think to do it is a brute force approach:
1) Read the first word from one file into a string 2) Read the first word of the second file into a string 3) Compare the two strings 4) Read the next word of the second file into the string 2 5) Repeat steps 3 and 4 until you reach the end of the file 6) Get the next word of the first file 7) Repeat steps 2 - 6 until you reach the end of the first file. 8) Print your results. If you have to compare file 1 word1 to file 2 word1, and then file1 word2 to file2 word2, etc. That is a simple read, compare, print. __________________
"To argue with a person who has renounced the use of reason is like administering medicine to the dead." -Thomas Paine www.sullivan-county.com/deism.htm |
|
#3
|
|||
|
|||
Re: c++ program..i need help please....From the description, it sounds more like the files are just a bunch of characters, not necessarily formatted in any way. Maybe something like:
Code:
|
|
#4
|
|||
|
|||
Re: c++ program..i need help please....its exactly what fakepoo said...
|
|
#5
|
|||
|
|||
Re: Locate similar words/phrases that are common to both filesCPP / C++ / C Code:
|
|
#6
|
|||
|
|||
Re: Locate similar words/phrases that are common to both filesthanks a lot ..thats good start
ok ill try to put it together and maybe you can help me finalize it.. thx |
Recent GIDBlog
Toyota - 2008 July Promotion by Nihal
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Two-Tier data dissemination code installation problem | nidhibansal1984 | Computer Software Forum - Linux | 6 | 16-Sep-2007 10:13 |
| BOOKEEPING program, HELP!! | yabud | C Programming Language | 10 | 17-Nov-2006 03:48 |
| Pipeline freeze simulation | darklightred | CPP / C++ Forum | 6 | 27-Jul-2006 19:37 |
| Help with a complex program | lordfuoco | CPP / C++ Forum | 5 | 24-Jun-2006 06:03 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The