-1

what does this warning mean? I read some other posts about a similar question, but I'm still not understanding how to go about solving it.

# define EOT_CHAR '\04'
char buffer[MAXLINE];

            if ( strstr( buffer, EOT_CHAR ) != NULL )
            {
                break;
            }
PetitPlaid
  • 91
  • 3
  • 8

1 Answers1

5

strstr is used to locate a substring and requires a pointer to a string as its second argument. To locate a character use strchr function.

ouah
  • 142,963
  • 15
  • 272
  • 331
  • Exactly. EOT_CHAR is a character, which is a special case of an integer in the C language. The strstr() function takes two pointers to characters, so the compiler was complaining that the second argument, which in you case was an integer, was being converted to a pointer. – Nick Stoughton Mar 18 '15 at 14:06