This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
cpp:vector_overloading_binary_operators2 [2021/05/07 14:37] gthanos |
cpp:vector_overloading_binary_operators2 [2021/05/24 06:45] (current) |
||
|---|---|---|---|
| Line 17: | Line 17: | ||
| | %%>> | | %%>> | ||
| - | <code cpp Vector.cpp> | + | <code cpp Vector.hpp> |
| #include < | #include < | ||
| #include < | #include < | ||
| #include < | #include < | ||
| using namespace std; | using namespace std; | ||
| + | |||
| + | #ifndef _VECTOR_HPP_ | ||
| + | #define _VECTOR_HPP_ | ||
| class Vector { | class Vector { | ||
| Line 60: | Line 63: | ||
| | | ||
| }; | }; | ||
| + | |||
| + | #endif | ||
| + | </ | ||
| + | |||
| + | <code cpp Vector.cpp> | ||
| + | #include " | ||
| Vector:: | Vector:: | ||
| Line 266: | Line 275: | ||
| return array[pos]; | return array[pos]; | ||
| } | } | ||
| + | </ | ||
| + | |||
| + | <code cpp VectorUsage.cpp> | ||
| + | #include " | ||
| int main() { | int main() { | ||