Skip to content

Commit 1dc7360

Browse files
authored
protected-cpp.md - grammar and consistency
1 parent 9f384cb commit 1dc7360

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/cpp/protected-cpp.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ The **`protected`** keyword specifies access to class members in the *member-lis
3030

3131
When preceding the name of a base class, the **`protected`** keyword specifies that the public and protected members of the base class are protected members of its derived classes.
3232

33-
Protected members are not as private as **`private`** members, which are accessible only to members of the class in which they are declared, but they are not as public as **`public`** members, which are accessible in any function.
33+
Protected members are not as private as **`private`** members, which are accessible only to members of the class in which they are declared but they are not as public as **`public`** members, which are accessible in any function.
3434

3535
Protected members that are also declared as **`static`** are accessible to any friend or member function of a derived class. Protected members that are not declared as **`static`** are accessible to friends and member functions in a derived class only through a pointer to, reference to, or object of the derived class.
3636

@@ -75,7 +75,7 @@ int main() {
7575
y.Display();
7676
// x.Protfunc(); error, Protfunc() is protected
7777
y.useProtfunc(); // OK, uses public access function
78-
// in derived class
78+
// in the derived class
7979
}
8080
```
8181

0 commit comments

Comments
 (0)