There is a code snippet

Int  matchstar( char c, char  *regexp, char  *text)
{
       Do {  
           /*   do sth */
         } while (*text != ‘\0’  && { ‘text++  == c|| c == ‘.’});
      Return  0;
}

I do not understand how does the logic in while work, in specific, what does

*text != ‘\0’  && { ‘text++  == c|| c == ‘.’}

mean?

text is a pointer to a character arrray. The star in front indicates dereference of the character. So if text == "Hello", then *text is looking at the first letter, 'H'. C strings are always terminated with the NULL character 0, or '\0'.

The while statement as written is poorly constructed. "{ *text++ == c|| c == ‘.’}" makes no sense. It should also use ( and ), not { and }.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.