User Tools

Site Tools


cpp:vector_overloading_unary_operators

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
cpp:vector_overloading_unary_operators [2019/05/16 09:18]
gthanos
cpp:vector_overloading_unary_operators [2021/05/24 07:37]
gthanos
Line 1: Line 1:
 ====== Υπερφόρτωση μοναδιαίων τελεστών (unary operators) ====== ====== Υπερφόρτωση μοναδιαίων τελεστών (unary operators) ======
 +
 +Ο παρακάτω πίνακας περιγράφει την υπερφόρτωση των τελεστών στο παράδειγμα της κλάσης //Vector// που ακολουθεί.
  
 ^  Τελεστής  ^  Θέση (πριν ή μετά το αντικείμενο)  ^  Περιγραφή  ^  Μεταβάλει το αντικείμενο<color red>*</color>  ^ Φιλική συνάρτηση ^ ^  Τελεστής  ^  Θέση (πριν ή μετά το αντικείμενο)  ^  Περιγραφή  ^  Μεταβάλει το αντικείμενο<color red>*</color>  ^ Φιλική συνάρτηση ^
Line 45: Line 47:
 #include <cstdlib> #include <cstdlib>
 using namespace std; using namespace std;
 +
 +#ifndef _VECTOR_HPP_
 +#define _VECTOR_HPP_
  
 class Vector { class Vector {
Line 80: Line 85:
                                              // elements in inverted sequence.                                              // elements in inverted sequence.
 }; };
 +
 +#endif
 +</code>
 +
 +<code cpp Vector.cpp>
 +#include "Vector.hpp"
  
 Vector::Vector(unsigned int length) { Vector::Vector(unsigned int length) {
Line 238: Line 249:
 } }
  
 +</code>
 +
 +<code cpp Vector.cpp>
 +#include "Vector.hpp"
  
 int main() { int main() {
cpp/vector_overloading_unary_operators.txt · Last modified: 2021/05/24 06:38 (external edit)