Really simple question about C ++ constant.
So, I read this post , then I tried this code:
int some_num = 5; const int* some_num_ptr = &some_num;
Why does the compiler not give an error, or at least a warning?
As I read the above statement, he says:
Create a pointer that points to a constant integer
But some_num is not a constant integer - it's just an int.
source share