|
-
January 19th, 2010, 05:01 PM
#15
Re: for/if/else dilemma
 Originally Posted by darkseid
ok. then i must have asked the wrong question. i'm going to reformulate.
why, when i use "Search: " i get answers from other ifs instead of getting only from one if.
and please, do critique the code.
sry if i'm confusing .. i'm sort of a begginer
tnx 
There are only two possibilities:
1) Your if statements end up comparing the same thing.
2) You have redundant entries in the data files.
Given the data, are you sure that these statements evaluate uniquely?
Code:
if ( strcmp ( a[i].word, search_word ) == 0 )
if ( strcmp (a[i].word_pl, search_word ) == 0 )
if ( strnicmp ( a[i].word, search_word,2 ) == 0 )
If you see duplicate entries, why don't you print out the file and line number, so when you see a duplicate, you can see the data that caused it to happen?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|