题解 | #嵌入式关键字const#
嵌入式关键字const
https://www.nowcoder.com/practice/0d9dd9e7551d413794875d25385a62bc
/**
* 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可
*
*
* @param n int整型
* @return int整型
*/
int const_test(int n ) {
// write code here
const int *p = &n;
n = n+4;
p= &n;
return *p;
}
上面n=n+4是因为int类型占4个字节,而且地址也是由字节构成。要返回p++就跟让n+4是一样的。
查看1道真题和解析

深信服公司福利 832人发布