#include <iostream>
using namespace std;
int main()
{
int add[10];
cout << add << endl;
cout << &add + 2 << endl;
int (*pas) [10] = &add;
cout << pas+1 << endl;
cout << pas+2 << endl;
add[0] = 88;
cout << "--------------------" << endl;
cout << pas << endl;
cout << *pas << endl;
cout << **pas << endl;
cout << (*pas)[0] << endl;
return 0;
}
[beyes@groad ~]$ ./address
0xbfc0c434
0xbfc0c484
0xbfc0c45c
0xbfc0c484
--------------------
0xbfc0c434
0xbfc0c434
88
88
#include <iostream>
using namespace std;
int main()
{
char add[10];
cout << add << endl;
return 0;
}
#include <iostream>
using namespace std;
int main()
{
char add[10];
cout << add << endl;
add[0] = 'a';
add[1] = 'b';
add[2] = 'c';
cout << &add[2] << endl;
return 0;
}
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |