![]() |
|
#1
|
|||
|
|||
Comparing strings in CHello, I'm new here and I have a question.
I'm doing this project for school and I need to compare a word in a file to a list fo words in a dictionary. It's basically a crappy spell checker. Anyways, I isolate the words in the file one by one and store them in an array of characters. This works fine, however when I comparer it to the dictionary file it says they never match up, though I know they do. So every word is printed as a typo. The dictionary file is a list of sequential words, one per line. I think this is what is getting me. As when it reads the dictionary file it grabs the new line character as well, then it doesn't compare properly with strcmp. Would this theory be right? I tried appending an extra '\n' to the end of each word as I grab it from the file, but that didn't work. neither did adding a NULL. Any help would be appreciated. |
|||
|
#2
|
|||
|
|||
|
Quote:
Post your code. Regards, Dave |
|
#3
|
|||
|
|||
|
I had to hand it in already. Thanks for the thought though!
|
Recent GIDBlog
Not selected for officer school by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| I am reviewing Arrays and need help converting some strings to arrays | jenmaz | C Programming Language | 22 | 22-Nov-2004 23:26 |
| comparing strings | yarons | C Programming Language | 6 | 19-Oct-2004 21:03 |
| Including Maps and strings?? | maddie | C++ Forum | 17 | 05-Jul-2004 06:25 |
| help on comparing structs | nusstu | C Programming Language | 4 | 03-Apr-2004 02:22 |
| How do you compare two strings? | soccer022483 | C++ Forum | 9 | 22-Mar-2004 14:45 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The