M
Michael Sgier
Hi
I get the error:
No case-independent string comparison (stricmp, strcasecmp)
with the code below. Why...where should stricmp
be defined? And how do i get rid of the error on Linux?
//
// Function portability
//
#ifndef HAVE_STRICMP
#ifdef HAVE_STRCASECMP
#define stricmp strcasecmp
#else
#error No case-independent string comparison (stricmp, strcasecmp)
available.
#endif
#endif // HAVE_STRICMP
another problem here:
#define DEBUG 1
main()
{
char inbuf[BUFSIZ];
int i = 0;
int lcnt = 0;
gets(inbuf);
while(*(inbuf+i))
{
#ifdef DEBUG
printf("Character %d Value %c(%o)\n",
i,*(inbuf+i),*(inbuf+i));
#endif
if(isalpha(*(inbuf+i)))lcnt++;
#ifdef DEBUG
printf("Letter Count %d\n",lcnt);
#endif
i++;
}
printf("Total letters %d\n",lcnt);
}
why is ifdef DEBUG 2x there?
Thanks
Michael
I get the error:
No case-independent string comparison (stricmp, strcasecmp)
with the code below. Why...where should stricmp
be defined? And how do i get rid of the error on Linux?
//
// Function portability
//
#ifndef HAVE_STRICMP
#ifdef HAVE_STRCASECMP
#define stricmp strcasecmp
#else
#error No case-independent string comparison (stricmp, strcasecmp)
available.
#endif
#endif // HAVE_STRICMP
another problem here:
#define DEBUG 1
main()
{
char inbuf[BUFSIZ];
int i = 0;
int lcnt = 0;
gets(inbuf);
while(*(inbuf+i))
{
#ifdef DEBUG
printf("Character %d Value %c(%o)\n",
i,*(inbuf+i),*(inbuf+i));
#endif
if(isalpha(*(inbuf+i)))lcnt++;
#ifdef DEBUG
printf("Letter Count %d\n",lcnt);
#endif
i++;
}
printf("Total letters %d\n",lcnt);
}
why is ifdef DEBUG 2x there?
Thanks
Michael