题一
char *ptr = "hello world";printf("sizeof(ptr) = %ldn",sizeof(ptr)); //测量的是ptr指针变量的结果printf("strlen(ptr) = %ldn",strlen(ptr));结果:sizeof(ptr) = 8strlen(ptr) = 11
题二
char *s1 = "hello world";char s2[100] = "hello world";printf("sizeof(s1) = %ldn", sizeof(s1));printf("sizeof(s2) = %ldn", sizeof(s2));printf("strlen(s1) = %ldn", strlen(s1));printf("strlen(s2) = %ldn", strlen(s2));求以上四个的输出结果。结果:sizeof(s1) = 8sizeof(s2) = 100strlen(s1) = 11strlen(s2) = 11