C语言面试题-指针

#include 
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语言面试题-指针_第1张图片

你可能感兴趣的:(c语言,java,算法,开发语言,数据结构,c++)