-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ch2/2.32.cpp #3
Comments
// pointer is supposed to store the address, here is a simple correction |
@AlesaW 1 & 5 compile w/ visual studio compiler, but not in GCC. |
Tested this locally. 1 & 5 do not compile with MSVC. As @simonZ0919 says, a pointer stores an address. The book itself gives the answer prior to this exercise section. The following is correct. int null = 0;
int *p = &null; |
Since this exercise was left in a section that talked about |
// Method 1
const int null1 = 0;
int *p1 = null1;
// Method 5
constexpr int null2 = 0;
int *p5 = null2;
are invalid, leads to type conversion error.
The text was updated successfully, but these errors were encountered: