Home / utk / cs102 / fa16 / labj / code_snippets / section1 / point3d.cpp
Directory Listing
argtest.cpp
point3d.cpp
string_to_int.cpp
test.ppm
vec_ex.cpp
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
30
31
32
33
34
35
36
37
#include <iostream>
#include <vector>

using namespace std;

struct point_3D {
	point_3D();
	point_3D(double, double, double);
	double x, y, z;
};

int main() {
	vector<point_3D> vec;

	point_3D p(1.2, 0, 82.212);
	/*
	 * p.x = 1.2;
	 * p.y = 0;
	 * p.z = 82.212;
	 */

	vec.push_back(p);

	cout << vec[0].x << endl;
}

point_3D::point_3D() {
	x = 0;
	y = 0;
	z = 0;
}

point_3D::point_3D(double a, double b, double c) {
	x = a;
	y = b;
	z = c;
}