You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
BPEMR/xi-note-computer/Xi-A-Program/Xi-XX-C++/大三/code/6函数/6.2.3const形参和实参.cpp

30 lines
301 B

//6.2.3const形参和实参.cpp
#include <iostream>
using namespace std;
void fa(const int as);
void fb(int as);
int main(){
int x=1,y=2;
const int a=1,b=2;
fa(x);
fa(a);
fb(y);
fb(b);
return 0;
}
void fa(const int as){
// 无法修改值
}
void fb(int as){
// 可修改值
as=12;
}