#include <stdio.h>
int main()
{
char str1[] = "hello bit.";//地址不同
char str2[] = "hello bit.";
const char* str3 = "hello bit.";//常量是不可以被修改的
const char* str4 = "hello bit.";//常量是不可以被修改的
if (str1 == str2)
printf("str1 and str2 are same\n");
else
printf("str1 and str2 are not same\n");//打印
if (str3 == str4)
printf("str3 and str4 are same\n");//打印
else
printf("str3 and str4 are not same\n");
return 0;
}
C语言面试题-指针
最新推荐文章于 2024-08-24 22:01:16 发布