First a compiler question...then the REAL question.
Given this strucutre...
why would my compiler complan that there is a signed/unsigned mismatch with this for loop statement?Code:typedef struct Key KEY; typedef struct Key* KEYS; struct Key { char *sender; char *addressee; char *regarding; DATE date; int id; char *fname; KEYS next; };
what's weird is that the compiler does not complian if I do it like this.Code:KEYS search(KEYS k, KEY ki ) { ....some code.... for(i=0;i<=strlen(ki.sender); i++) temp.sender[i]=tolower(ki.sender[i]); ...some more case conversion }
utlimately, what I am trying to do is prepare two strings for a non-case sensitive comparison. So that "BARBARA" would match "Barbara".Code:len=strlen(ki.sender) for(i=0;i<=len; i++) temp.sender[i]=tolower(ki.sender[i]);
Is there an easier (or more clever) way to do this operation on a string beside the way I am trying to do it in the for loop up above? I hate using the temp.
Thanks,
Mike



LinkBack URL
About LinkBacks


