Looks like I miss something, so I need your help, guys.
#include <iostream>
using namespace std;
int main() {
int* ptr=new int(2);
const int* constPtr=ptr;
int** ptr2;
//... do memory stuff for ptr2
const int** constPtr2=ptr2;
typedef int** intPtr;
const intPtr ptr3 = ptr2;
return 0;
}
Questions:
1. Line #8 works (at least my compiler doesn't comply), but line #12 is not allowed. Why?
2. Line #15 is equal to int** const
. I thought it should be rather const int**
.