Website Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
1 files changed, 9 insertions, 11 deletions
-rw-r--r--Sem. 05/README.md20
diff --git a/Sem. 05/README.md b/Sem. 05/README.md
index a578944..23d1bbb 100644
--- a/Sem. 05/README.md
+++ b/Sem. 05/README.md
@@ -30,11 +30,11 @@ public:
setGrade(grade);
setAge(age);
}
- int getGrade()
+ int getGrade() const
{
return grade;
}
- int getAge()
+ int getAge() const
{
return age;
}
@@ -52,16 +52,14 @@ public:
int main()
{
- while ()
- {
- Test t;// Object is created
- if ()
- {
- Test t2; // Object is created
-
- }// Object is destroyed (t2)
+ Student s(2,3);
+
+ //s.grade = -1; would not compile (grade is private)
+
+ std::cout << s.getGrade(); //return a copy of the grade
+
+ s.setAge(5); //return a copy of the grade
- }//Object is destroyed (t)
}
```