- 论坛徽章:
- 0
|
同志们能否帮忙看看下面的程序
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
char *a = "aaaa";
char *b = "bbbb";
char *c = "cccc";
char **k,**t;
k=&a;
t=k;
k++;
k=&b;
k++;
k=&c;
cout<<"==========this is k=========="<<endl;
cout<<*k<<endl;
k--;
cout<<*k<<endl;
k--;
cout<<*k<<endl;
cout<<"==========this is t=========="<<endl;
cout<<*t<<endl;
t++;
cout<<*t<<endl;
t++;
cout<<*t<<endl;
system("PAUSE");
return EXIT_SUCCESS;
}
我在unix下运行的结果是:
==========this is k==========
cccc
bbbb
aaaa
==========this is t==========
aaaa
bbbb
cccc
但是在window上运行的结构却是:
==========this is k==========
cccc
h |
|