english
This commit is contained in:
BIN
english/basic_content/const/funciton_const/condition2/condition1
Executable file
BIN
english/basic_content/const/funciton_const/condition2/condition1
Executable file
Binary file not shown.
@@ -0,0 +1,10 @@
|
||||
#include<iostream>
|
||||
using namespace std;
|
||||
int main(){
|
||||
|
||||
int num=0;
|
||||
int * const ptr=# //const指针必须初始化!且const指针的值不能修改
|
||||
int * t = #
|
||||
*t = 1;
|
||||
cout<<*ptr<<endl;
|
||||
}
|
@@ -0,0 +1,8 @@
|
||||
#include<iostream>
|
||||
using namespace std;
|
||||
int main(){
|
||||
|
||||
const int num=0;
|
||||
int * const ptr=# //error! const int* -> int*
|
||||
cout<<*ptr<<endl;
|
||||
}
|
BIN
english/basic_content/const/funciton_const/condition2/condition3
Executable file
BIN
english/basic_content/const/funciton_const/condition2/condition3
Executable file
Binary file not shown.
@@ -0,0 +1,8 @@
|
||||
#include<iostream>
|
||||
using namespace std;
|
||||
int main(){
|
||||
|
||||
const int num=10;
|
||||
const int * const ptr=# //error! const int* -> int*
|
||||
cout<<*ptr<<endl;
|
||||
}
|
Reference in New Issue
Block a user