| 11 | } |
| 12 | |
| 13 | int main() |
| 14 | { |
| 15 | int num = 1; |
| 16 | int another = 2; |
| 17 | |
| 18 | //You cannot change the value that p1 points to through p1 |
| 19 | const int * p1 = # |
| 20 | *p1 = 3; //error |
| 21 | num = 3; //okay |
| 22 | |
| 23 | //You cannot change value of p2 (address) |
| 24 | int * const p2 = # |
| 25 | *p2 = 3; //okay |
| 26 | p2 = &another; //error |
| 27 | |
| 28 | //You can change neither |
| 29 | const int* const p3 = # |
| 30 | *p3 = 3; //error |
| 31 | p3 = &another; // error |
| 32 | |
| 33 | return 0; |
| 34 | } |
nothing calls this directly
no outgoing calls
no test coverage detected