summaryrefslogtreecommitdiff
path: root/4p16.cpp
blob: 5205446063100929d4bb5d549c4883817507db68 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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;
}