#include <iostream>
using namespace std;
int main()
{
long i[2]={1,2};
long i1[2]={3,4};
const long* u=i;
const long* u1=i1;
cout<<*u;
cout<<" "<<*(++u)<<endl;
//cout<<*u<<" "<<*(u++)<<endl; --结果不确定,不能这么用
cout<<*u1;
cout<<" "<<*(++u1)<<endl;
//cout<<*u<<" "<<*(u1++)<<endl;
//cout<<*(u--)<<" "<<*(u1--)<<endl;
//cout<<*(u--)<<" "<<*(u1--)<<endl;
cout<<*u<<endl;
cout<<" "<<*u1<<endl;
cout<<*(--u)<<endl;
cout<<*(--u1)<<endl;
//u=9; 提示:assignment of read-only location
return 0;
}
2010.12.12--cout 一个错误
最新推荐文章于 2010-12-19 22:34:00 发布