english
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
#include<iostream>
|
||||
using namespace std;
|
||||
|
||||
|
||||
int main(){
|
||||
const int *ptr;
|
||||
*ptr=10; //error
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
#include<iostream>
|
||||
using namespace std;
|
||||
|
||||
|
||||
int main(){
|
||||
const int p = 10;
|
||||
const void *vp = &p;
|
||||
void *vp = &p; //error
|
||||
}
|
@@ -0,0 +1,12 @@
|
||||
#include<iostream>
|
||||
using namespace std;
|
||||
|
||||
int main(){
|
||||
const int *ptr;
|
||||
int val = 3;
|
||||
ptr = &val; //ok
|
||||
int *ptr1 = &val;
|
||||
*ptr1=4;
|
||||
cout<<*ptr<<endl;
|
||||
|
||||
}
|
Reference in New Issue
Block a user