mirror of
https://github.com/Light-City/CPlusPlusThings.git
synced 2026-02-04 02:54:42 +08:00
update dir
This commit is contained in:
11
const/const_function.cpp
Normal file
11
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