-
內(nèi)聯(lián)函數(shù)定義
查看全部 -
?函數(shù)重載的方式:系統(tǒng)自動(dòng)把函數(shù)名變?yōu)榕c定義有關(guān)的新函數(shù)名。
查看全部 -
函數(shù)重載的定義
查看全部 -
函數(shù)默認(rèn)值的使用
查看全部 -
函數(shù)參數(shù)默認(rèn)值
查看全部 -
代碼示例3
查看全部 -
錯(cuò)誤示例2
查看全部 -
錯(cuò)誤示例啊
查看全部 -
const 與 引用
查看全部 -
注意
123
查看全部 -
const的位置
查看全部 -
int 為變量
查看全部 -
一、a pointer to a constant:(指向常量的指針):可以改變指針中存儲(chǔ)的地址,但不允許使用指針改變他指向的值。
eg:int value = 2;
const int *pvalue = &value;//defines a pointer to a constant
*pvalue = 88;//error-attempet to change const location
num = 12;
pvalue = #//ok-changeing the address in pvalue
二、constant pointer(常量指針):指針中存儲(chǔ)的地址不能改變,但可以使用指針改變他指向的值。
eg:int count? = 22;
int * const pcount = & count;
int item = 12;
pcout = &item;//error-attempt to change a constant pointer
*pcount = 21;//ok-changes the value of count
查看全部 -
有默認(rèn)參數(shù)值的參數(shù)必須在參數(shù)表的最右邊
void fun(int i,int j=5,int k=10); ?這樣是正確的
void fun(int i,int j=5,int k);錯(cuò)誤
查看全部 -
申請(qǐng)內(nèi)存負(fù)值字符串
查看全部
舉報(bào)