Null-Terminated string

后端 未结 4 1381
一个人的身影
一个人的身影 2021-01-17 15:26

Which of the following are null-terminated string?

char *str1 = \"This is a string.\";
char *str2 = \"This is a string.\\0\";
char str3[] = \"This is a strin         


        
4条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-17 16:12

    All. C compiler auto aggregates string with a terminate '\0', then store it in a char[] or refer to it by char *;

提交回复
热议问题