◐ Shell
clean mode source ↗

access specifiers – cppreference.com

Aus cppreference.com

<metanoindex/>

In einer class oder struct Körper definieren die Sichtbarkeit der folgenden Deklaratoren

Original:

In a class or struct body define the visibility of following declarators

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

In einer Erbschaft Liste definieren die maximale Sichtbarkeit der geerbten Elemente

Original:

In a inheritance list, define the maximum visibility of inherited members

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Syntax

public: declarators (1)
protected: declarators (2)
private: declarators (3)
class identifier : public class_name (4)
class identifier : protected class_name (5)
class identifier : private class_name (6)

Erklärung

# Die Symbole erklärt, nachdem die specifier öffentliche Zugänglichkeit haben

Original:

# The symbols declared after the specifier have public accessibility

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

# Die Symbole erklärt, nachdem die specifier Zugänglichkeit geschützt haben

Original:

# The symbols declared after the specifier have protected accessibility

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

# Die Symbole erklärt, nachdem die specifier privaten Zugang haben

Original:

# The symbols declared after the specifier have private accessibility

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

# Die geerbten Member haben den gleichen Zugang wie das Basisklasse (entweder geschützt oder öffentlich werden nicht in der abgeleiteten Klasse sichtbar privat)

Original:

# The inherited members have the same accessibility as the base class ( either protected or public as private won't be visible in the derived class )

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

# Die geerbten Mitglieder haben Zugang in der abgeleiteten Klasse geschützt

Original:

# The inherited members have protected accessibility in the derived class

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

# Die geerbten Member haben private Erreichbarkeit in der abgeleiteten Klasse

Original:

# The inherited members have private accessibility in the derived class

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Mitglied Erreichbarkeit Spezifizierer

, Öffentliche

Original:

;public

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

öffentliche Mitglieder zugänglich sind überall, innerhalb und außerhalb der Gültigkeitsbereich der Klasse

Original:

public members are accessible everywhere, within and outside the class scope

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

; Geschützt

Original:

;protected

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

protected-Elemente sind innerhalb der Klasse und ihrer Methoden und ihrer Nachkommen

Original:

protected members are accessible within the class and its methods and in its descendants

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

; Private

Original:

;private

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

private Mitglieder kann nur innerhalb der Klasse und ihrer Methoden zugegriffen werden

Original:

private members can be only accessed within the class and its methods

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Um den Zugriff auf externe Funktionen oder Klassen protected oder private Mitglieder zu gewähren, muss ein Freundschaft Erklärung vorhanden sein in der Klasse Körper

Original:

To grant access to external functions or classes to protected or private members, a Freundschaft Erklärung must be present in the class body

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Vererbte private Mitglieder sind immer noch präsent in der Klasse Daten, kann aber nicht direkt zugegriffen werden

Original:

Inherited private members are still present in the class data but cannot be accessed directly

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

A class hat standardmäßig privat Zugänglichkeit für Erbschafts-und Mitglieder, hat eine struct stattdessen eine voreingestellte öffentliche Zugänglichkeit

Original:

A class has default private accessibility for inheritance and members, a struct has instead a default public accessibility

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.