摘要:
对“&”和“*”运算符再做些说明:(1) 如果已执行了“pointer_1=&a;”语句,请问&*pointer_1的含义是什么?“&”和“*”两个运算符的优先级别相同,但按自右至左方向结合,因此先 进行*pointer_1的运算,它就是变量a,再执行&运 算。因此,&*pointer_1与&a相同... 阅读全文
posted @ 2014-07-18 16:08
galoishelley
阅读(233)
评论(0)
推荐(0)
摘要:
只能对字符数组的元素赋值,而不能用赋值语句对整个数组赋值.char c[5];c={′C′,′h′,′i′,′n′,′a′}; //错误,不能对整个数组一次赋值c[0]=′C′; c[1]=′h′;c[2]=′i′;c[3]=′n′;c[4]=′a′; //对数组元素赋值,正确如果已定义了a和b是具... 阅读全文
posted @ 2014-07-18 11:10
galoishelley
阅读(1128)
评论(0)
推荐(0)
摘要:
1. 用数组元素作函数实参 1 #include 2 using namespace std; 3 4 int max_value(int x, int max) 5 { 6 return max > x ? max : x; 7 } 8 9 int main()10 {11 ... 阅读全文
posted @ 2014-07-18 10:13
galoishelley
阅读(2893)
评论(0)
推荐(0)