◐ Shell
clean mode source ↗

access specifiers — cppreference.com

De cppreference.com

<metanoindex/>

Dans un class ou un organisme struct définir la visibilité de déclarateurs suivantes

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.

Dans une liste d'héritage, de définir le maximum de visibilité des membres hérités

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.

Syntaxe

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)

Explication

# Les symboles déclaré après le spécificateur ont accessibilité au public

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.

# Les symboles déclaré après le spécificateur ont protégé l'accessibilité

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.

# Les symboles déclaré après le spécificateur ont accès privé

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.

# Les membres hérités avoir la même accessibilité que la classe de base (soit protégé ou public comme privé ne sera pas visible dans la classe dérivée)

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.

# Les membres hérités ont protégé l'accessibilité dans la classe dérivée

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.

# Les membres hérités ont accès privé à la classe dérivée

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.

L'accessibilité membre par spécificateur

; Public

Original:

;public

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

membres du public sont accessibles partout, à l'intérieur et à l'extérieur de la portée d'une classe

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.

; Protégé

Original:

;protected

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

membres protégés sont accessibles au sein de la classe et de ses méthodes et de ses descendants

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.

; Privé

Original:

;private

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

membres privés peut être accessible uniquement au sein de la classe et ses méthodes

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.

Pour accorder l'accès à des fonctions externes ou des classes pour les membres protégés ou privés, une déclaration d'amitié doit être présent dans le corps de la classe

Original:

To grant access to external functions or classes to protected or private members, a déclaration d'amitié 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.

Héritée membres privés sont encore présents dans les données de la classe, mais ne sont pas accessibles directement

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.

Un class a accès privé par défaut de l'héritage et des membres, un struct a plutôt une accessibilité au public par défaut

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.