
void print_msg(char *msg)
{
    while(*msg)
       {
       P0 = *msg;
       ...do whatever
       msg++;
       }
}
'c' appends a null character '\0' or 0x00 onto the ends of strings, so the statement 'while (*msg)' translates into "while the current character value is not equal to zero, do"

