diff options
Diffstat (limited to '4p16.cpp')
-rw-r--r-- | 4p16.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/4p16.cpp b/4p16.cpp new file mode 100644 index 0000000..5205446 --- /dev/null +++ b/4p16.cpp @@ -0,0 +1,29 @@ +#include <iostream> + +/* + * + * 4.16 + * + * Added a mockup getPtr function to demonstrate + */ + +int *getPtr(int *f) { + + return f; +} + +int main () { + + int f; + int *p = nullptr; + if ((p = getPtr(&f)) != 0) { + std::cout << "not nullptr" << std::endl; + } + + int i = 1024; + if (i == 1024) { + std::cout << "i: 1024" << std::endl; + } + + return 0; +} |