64,654
社区成员
发帖
与我相关
我的任务
分享
#include<iostream>
using namespace std;
int main()
{
char a[10] = "abcdefghi";
int b[2] = {1,2};
cout<<a<<endl;
cout<<b<<endl;
return 0;
}
#include<iostream>
using namespace std;
int main()
{
char a[10] = "abcdefghi";
int b[2] = {1,2};
cout << &a << " " << &a[0] <<endl; //这样都可以输出第一个元素的地址
cout<<a<<endl;
cout<<b<<endl;
return 0;
}
#include<iostream>
#include <cstdio>
using namespace std;
int main()
{
char a[] = "abcdefghi";
int b[2] = {1,2};
char*p=a;
cout<< (int*)p<<endl;//改一下啦。
cout<<b<<endl;
system("pause");
return 0;
}
#include<iostream>
using namespace std;
int main()
{
char a[10] = "abcdefghi";
int b[2] = {1,2};
char *p = a;
cout<<p<<endl;
cout<<b<<endl;
return 0;
}
cout<<&a<<endl;
cout<<(void*)a<<endl;
cout<<static_cast<void*>(a)<<endl;
#include<iostream>
using namespace std;
int main()
{
char a[10] = "abcdefghi";
int b[2] = {1,2};
cout<< &a<<endl;//改下就可以了
cout<<b<<endl;
system("pause");
return 0;
}