const 函数参数

void func(int value);

这样的函数,不可以这样子使用: 

const int value =100;

func(value );

因为func里面可能会对value进行更改,将const类型传入,里面的代码可能无法运行。 

posted @ 2014-09-30 21:32  lycan785  阅读(282)  评论(0编辑  收藏  举报