CPlusPlusThings/english/basic_content/const/funciton_const/condition1/condition3.cpp
2020-07-18 17:09:29 +08:00

13 lines
171 B
C++

#include<iostream>
using namespace std;
int main(){
const int *ptr;
int val = 3;
ptr = &val; //ok
int *ptr1 = &val;
*ptr1=4;
cout<<*ptr<<endl;
}