summaryrefslogtreecommitdiff
path: root/3p34.cpp
blob: 84d148b22b700d3e73404ebde1423ffff9a227db (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
#include <iostream>
#include <vector>
#include "sales_data.hpp"
#include "sales_item.hpp"

/*
 *
 * 3.34
 *
 *
 */

int main () {

	int ia[] = {1,2,3,4,5,6,7,8,9,10};
	int *p1 = ia + 12;
	int *p2 = ia + 0;
	// Well as long as p2 is pointing to a valid element in the array it seems like
	// changing values in p1 cant make it illegal.
	// Though if i change p2 to point to -1 or lower then i get a buffer underflow
	
	// -12
	// p1 = -12
	// p1[-12] = ia[0]
	p1 += p2 - p1;
	std::cout << *p1 << " " << *p2 << std::endl;
	return 0;
}