最近一致在看些C方面的题,这个题求输出,分析也看了,就是不了解深拷贝和浅拷贝是什么东东,求解- #include <stdio.h>
- int main{
- char str1[] = "abc";
- char str2[] = "abc";
-
- const char str3[] = "abc";
- const char str4[] = "abc";
-
- const char *str5 = "abc";
- const char *str6 = "abc";
-
- char *str7 = "abc";
- char *str8 = "abc";
-
- if ( str1 == str2 ) printf("1\n");
- if ( str3 == str4 ) printf("2\n");
- if ( str5 == str6 ) printf("3\n");
- if ( str7 == str8 ) printf("4\n");
- return 0;
- }
复制代码
|