You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/cpp/member-access-control-cpp.md
+40-23Lines changed: 40 additions & 23 deletions
Original file line number
Diff line number
Diff line change
@@ -68,28 +68,44 @@ protected: // Declare protected function for derived classes only.
68
68
69
69
```cpp
70
70
// access_specifiers_for_base_classes.cpp
71
-
classBaseClass
72
-
{
73
-
public:
74
-
int PublicFunc(); // Declare a public member.
75
-
protected:
76
-
int ProtectedFunc(); // Declare a protected member.
77
-
private:
78
-
int PrivateFunc(); // Declare a private member.
79
-
};
80
-
71
+
classBaseClass
72
+
{
73
+
public:
74
+
int PublicFunc(); // Declare a public member.
75
+
protected:
76
+
int ProtectedFunc(); // Declare a protected member.
77
+
private:
78
+
int PrivateFunc(); // Declare a private member.
79
+
};
80
+
81
81
// Declare two classes derived from BaseClass.
82
-
classDerivedClass1 : publicBaseClass
83
-
{
84
-
};
85
-
86
-
classDerivedClass2 : privateBaseClass
87
-
{
88
-
};
89
-
90
-
intmain()
91
-
{
92
-
}
82
+
classDerivedClass1 : publicBaseClass
83
+
{
84
+
void foo()
85
+
{
86
+
PublicFunc();
87
+
ProtectedFunc();
88
+
PrivateFunc(); // function is inaccessible
89
+
}
90
+
};
91
+
92
+
classDerivedClass2 : privateBaseClass
93
+
{
94
+
void foo()
95
+
{
96
+
PublicFunc();
97
+
ProtectedFunc();
98
+
PrivateFunc(); // function is inaccessible
99
+
}
100
+
};
101
+
102
+
intmain()
103
+
{
104
+
DerivedClass1 derived_class1;
105
+
DerivedClass2 derived_class2;
106
+
derived_class1.PublicFunc();
107
+
derived_class2.PublicFunc(); // function is inaccessible
108
+
}
93
109
```
94
110
95
111
In `DerivedClass1`, the member function `PublicFunc` is a public member and `ProtectedFunc` is a protected member because `BaseClass` is a public base class. `PrivateFunc` is private to `BaseClass`, and it is inaccessible to any derived classes.
@@ -216,5 +232,6 @@ Access Along Paths of an Inheritance Graph
216
232
217
233
In the figure, a name declared in class `VBase` is always reached through class `RightPath`. The right path is more accessible because `RightPath` declares `VBase` as a public base class, whereas `LeftPath` declares `VBase` as private.
218
234
219
-
## See also
220
-
[C++ Language Reference](../cpp/cpp-language-reference.md)
235
+
236
+
## See Also
237
+
[C++ Language Reference](../cpp/cpp-language-reference.md)
Copy file name to clipboardExpand all lines: docs/intrinsics/interlockeddecrement-intrinsic-functions.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ ms.workload: ["cplusplus"]
15
15
# _InterlockedDecrement Intrinsic Functions
16
16
**Microsoft Specific**
17
17
18
-
Provides compiler intrinsic support for the Win32 Windows SDK [InterlockedDecrement](/windows/desktop/api/winbase/nf-winbase-interlockeddecrement) function.
18
+
Provides compiler intrinsic support for the Win32 Windows SDK [InterlockedDecrement](/windows/desktop/api/winbase/nf-winbase-interlockeddecrement) function.
|[in]*clrBar*|A [COLORREF](http://msdn.microsoft.com/library/windows/desktop/dd183449) value that specifies the new color of the progress indicator bar. Specify CLR_DEFAULT to cause the progress bar to use its default color.|
304
304
305
305
### Return Value
306
-
The previous color of the progress indicator bar, represented as a [COLORREF](http://msdn.microsoft.com/library/windows/desktop/dd183449) value, or CLR_DEFAULT if the color of the progress indicator bar is the default color.
306
+
307
+
The previous color of the progress indicator bar, represented as a [COLORREF](http://msdn.microsoft.com/library/windows/desktop/dd183449) value, or CLR_DEFAULT if the color of the progress indicator bar is the default color.
307
308
308
309
### Remarks
309
310
310
-
The `SetBarColor` method sets the progress bar color only if a Windows Vista [theme](/windows/desktop/Controls/visual-styles-overview) is not in effect.
311
+
The `SetBarColor` method sets the progress bar color only if a Windows Vista [theme](/windows/desktop/Controls/visual-styles-overview) is not in effect.
311
312
312
313
This method sends the [PBM_SETBARCOLOR](http://msdn.microsoft.com/library/windows/desktop/bb760838) message, which is described in the Windows SDK.
0 commit comments