這節(jié) 直接看看會不會就行,然后看看 答案就行, 點(diǎn)那個(gè)提交沒啥用- - ,實(shí)在想知道結(jié)果的可以去VS上試一試,這網(wǎng)頁判斷的不是很準(zhǔn)~
個(gè)人認(rèn)為*p可以讀為p的地址,那么*p=10也就可以讀為使p的地址變成10,而*p即p的地址
x被賦值10。
x被賦值10。
2017-06-27
#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;
}
最新回答 / TTshuanger
重載函數(shù)與默認(rèn)參數(shù)重疊導(dǎo)致的二義性問題 func(int);???????????????????????????????????????????//重載函數(shù)1,只有1個(gè)參數(shù),無默認(rèn)參數(shù) func(int a, int b =4);???????????????????????????//重載函數(shù)2,有2個(gè)參數(shù),有1個(gè)默認(rèn)參數(shù) func(int a=3, int b=4, int c=6);?????????? //重載函數(shù)3,有3個(gè)參數(shù),有3個(gè)默認(rèn)參數(shù)出現(xiàn)二義性,fun(1,2)會編譯失敗的。
2017-06-20
#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;
}