Differences

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

Link to this comparison view

poo-is-ab:tema:00 [2024/12/07 13:46]
razvan.cristea0106 [4. Clase și metode]
poo-is-ab:tema:00 [2024/12/07 13:51] (current)
razvan.cristea0106 [3. Formatare]
Line 38: Line 38:
   * **Acolade**:​ Stil Allman (acoladele deschise pe linie separată).   * **Acolade**:​ Stil Allman (acoladele deschise pe linie separată).
  
 +<code cpp>
     class MyClass     class MyClass
     {     {
Line 46: Line 47:
         }         }
     };     };
 +</​code>​
  
   * **Lungimea liniei**: maxim 80 de caractere.   * **Lungimea liniei**: maxim 80 de caractere.
Line 62: Line 64:
   * **Getter și Setter**:   * **Getter și Setter**:
  
-    * Getterii trebuie să fie constante ​(ex. ''​int getValue() const;''​). +    * Getterii trebuie să fie constanți ​(ex. ''​int getValue() const;''​).
     * Metodele care nu modifică obiectul trebuie să fie declarate const.     * Metodele care nu modifică obiectul trebuie să fie declarate const.
  
Line 74: Line 75:
     public:     public:
         int getValue() const { return m_value; }         int getValue() const { return m_value; }
-        void setValue(int value) { m_value = value; }+        void setValue(const intvalue) { m_value = value; }
     };     };
 </​code>​ </​code>​
poo-is-ab/tema/00.1733571967.txt.gz · Last modified: 2024/12/07 13:46 by razvan.cristea0106
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0