char strInput[7] = "ABCDEF"
或
char strInput[] = "ABCDEF";
int i = sizeof(strInput) ;
i的值为7
char *strInput = "ABCDEF"
int i = sizeof(strInput) ;
i的值为4
strInput为指针, sizeof(strInput) 返回的是指针的大小, 一般指针站4个字节
char strInput[] = "ABCDEF";
int i = strlen(strInput);
i的值为6
会有警告 :从“size_t”转换到“int”,可能丢失数据