mirror of
https://github.com/Light-City/CPlusPlusThings.git
synced 2026-02-14 07:55:50 +08:00
english
This commit is contained in:
11
english/basic_content/const/const_function.cpp
Normal file
11
english/basic_content/const/const_function.cpp
Normal file
@@ -0,0 +1,11 @@
|
||||
#include<iostream>
|
||||
using namespace std;
|
||||
|
||||
void f(const int i){
|
||||
i=10; // error: assignment of read-only parameter ‘i’
|
||||
cout<<i<<endl;
|
||||
}
|
||||
|
||||
int main(){
|
||||
f(1);
|
||||
}
|
||||
Reference in New Issue
Block a user