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_operators [2021/05/07 14:34] gthanos |
cpp:vector_overloading_binary_operators [2021/05/24 06:42] (current) |
||
|---|---|---|---|
| Line 23: | Line 23: | ||
| </ | </ | ||
| - | <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 69: | Line 72: | ||
| //friend Vector operator>> | //friend Vector operator>> | ||
| }; | }; | ||
| + | |||
| + | #endif | ||
| + | </ | ||
| + | |||
| + | <code cpp Vector.cpp> | ||
| + | #include " | ||
| Vector:: | Vector:: | ||
| Line 314: | Line 323: | ||
| return n; | return n; | ||
| } | } | ||
| + | </ | ||
| + | <code cpp VectorUsage.cpp> | ||
| + | #include " | ||
| int main() { | int main() { | ||