![]() |
|
#1
|
|||
|
|||
string comparelet say,
you have array=["how", "kick", "you"] ...code here..... . . . the program does is when user enter a string, such as "how he kick you" then the program will compare the each word on the string to the array, check if they match. like, it take "how" from string the user enter, and compare to array, see if it match to the array. if yes, check next word "he", so on. anyone can help how to start programming this? |
|||
|
#2
|
||||
|
||||
|
There are many ways to solve this task. Have you tried *anything*? Honestly, I don't really want to help you, because given your post, you don't appear to have actually attempted to solve the problem on your own. On the contrary, I do want to help you because this problem could drive you insane! You simply have to copy the user's input into a new array that looks like the one you already have, then compare each element in the input array to each other element in the first array for equality. If you are using an array of string objects, it may be useful for you to know that array subscripts work with string objects.
__________________
-Aaron |
|
#3
|
||||
|
||||
|
i simply code 1 for you
duno is that what you want or not CPP / C++ / C Code:
Last edited by dsmith : 04-May-2004 at 08:22.
Reason: Please use [c] &[/c] for syntax highlighting
|
Recent GIDBlog
Programming ebook direct download available by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Including Maps and strings?? | maddie | C++ Forum | 17 | 05-Jul-2004 07:25 |
| string comparison | soccer022483 | C++ Forum | 2 | 21-Mar-2004 22:13 |
| Speed up compare algorithm | captnsaj | C++ Forum | 4 | 04-Feb-2004 15:50 |
| [function] AutoLink (converts URLS into links inside a string) | JdS | PHP Code Library | 0 | 26-Jan-2004 06:02 |
| storing a token pointer as a string | CoreLEx | C Programming Language | 1 | 07-Oct-2003 12:33 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The