天天看點

數組結束符\0與0的問題

#include stdio.h>

#include string.h>

int main(int argc,char** argv)

{

    char s1[] = "abcd0xyz";

    printf("s1 is %s\n",s1);

    char s2[] = "abcd\0xyz";

    printf("s2 is %s\n",s2);

    return 0;

}