This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
|
cpp:acccess_modifiers [2017/05/09 12:45] gthanos [Προσδιοριστές Πρόσβασης] |
cpp:acccess_modifiers [2018/05/02 08:12] gthanos [Παράδειγμα χρήσης προσδιοριστών πρόσβασης] |
||
|---|---|---|---|
| Line 61: | Line 61: | ||
| void Cube:: | void Cube:: | ||
| setWidth(s); | setWidth(s); | ||
| + | //width = s; // this does not compile | ||
| setHeight(s); | setHeight(s); | ||
| setLength(s); | setLength(s); | ||
| Line 67: | Line 68: | ||
| <code cpp CubeUsage.cpp> | <code cpp CubeUsage.cpp> | ||
| - | include " | + | #include " |
| int main() { | int main() { | ||
| Cuboid cuboid(1, | Cuboid cuboid(1, | ||
| + | // | ||
| Cube cube(1, 0xcccccc); | Cube cube(1, 0xcccccc); | ||
| cuboid.setWidth(5); | cuboid.setWidth(5); | ||