PageRenderTime 21ms CodeModel.GetById 17ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Examples/java/reference/example.h

#
C++ Header | 26 lines | 19 code | 6 blank | 1 comment | 0 complexity | a4c613d41f6c587138046ce6cf54ff4c MD5 | raw file
 1/* File : example.h */
 2
 3class Vector {
 4private:
 5  double x,y,z;
 6public:
 7  Vector() : x(0), y(0), z(0) { };
 8  Vector(double x, double y, double z) : x(x), y(y), z(z) { };
 9  friend Vector operator+(const Vector &a, const Vector &b);
10  char *print();
11};
12
13class VectorArray {
14private:
15  Vector *items;
16  int     maxsize;
17public:
18  VectorArray(int maxsize);
19  ~VectorArray();
20  Vector &operator[](int);
21  int size();
22};
23
24
25
26