#include <iostream>
using namespace std;
int main(void)
{
//定义常量count
const int count = 3;
const int *p = &count;
//打印count次字符串Hello C++
for(int i = 0; i < count; i++)
{
cout << "Hello imooc" << endl;
}
return 0;
}
using namespace std;
int main(void)
{
//定义常量count
const int count = 3;
const int *p = &count;
//打印count次字符串Hello C++
for(int i = 0; i < count; i++)
{
cout << "Hello imooc" << endl;
}
return 0;
}
#include <iostream>
using namespace std;
int main(void)
{
int x = 3;
//定义引用,y是x的引用
int &y = x;
//打印x和y的值
cout<<"x = "<<x<<" y = "<<y<<endl;
//修改y的值
y = 8;
//再次打印x和y的值
cout<<"x = "<<x<<" y = "<<y<<endl;
return 0;
}
using namespace std;
int main(void)
{
int x = 3;
//定义引用,y是x的引用
int &y = x;
//打印x和y的值
cout<<"x = "<<x<<" y = "<<y<<endl;
//修改y的值
y = 8;
//再次打印x和y的值
cout<<"x = "<<x<<" y = "<<y<<endl;
return 0;
}