Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include "Vector.h"
- Vector::Vector()
- {
- v_P = 3;
- v_col = new int[v_P];
- for(int k = 0; k < v_P; k++) v_col[k] = 0;
- }
- Vector::~Vector()
- {
- delete[] v_col;
- }
- void Vector::construct(int P)
- {
- v_P = P;
- for(int k = 0; k < P; k++) v_col[k] = 0;
- }
- void Vector::set(int P, int val)
- {
- v_col[P] = val;
- }
- void Vector::print()
- {
- std::cout << "[ ";
- for(int k = 0; k < v_P; k++) std::cout << v_col[k] << " ";
- std::cout << "]";
- }
Advertisement
Add Comment
Please, Sign In to add comment