First a compiler question...then the REAL question.
Given this strucutre...
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;
};
why would my compiler complan that there is a signed/unsigned mismatch with this for loop statement?
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
}
what's weird is that the compiler does not complian if I do it like this.
Code:
len=strlen(ki.sender)
for(i=0;i<=len; i++)
temp.sender[i]=tolower(ki.sender[i]);
utlimately, what I am trying to do is prepare two strings for a non-case sensitive comparison. So that "BARBARA" would match "Barbara".
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