这个面试题要肿么回答?
程序代码:
#include<stdio.h> #include<string.h> int main ( void ) { char *r1 = "hello" ; char r2[] = "hello" ; char r3[] = {'h','e','l','l','o'} ; printf("r3[5] : %c\n", *(r3+5) ) ; printf("r3[6] : %c\n", *(r3+6) ) ; printf("r1 : %d %d \n", sizeof( r1 ) , strlen( r1 ) ) ; printf("r2 : %d %d \n", sizeof( r2 ) , strlen( r2 ) ) ; printf("r3 : %d %d \n", sizeof( r3 ) , strlen( r3 ) ) ; return 0 ; }