Which symbol is used to create multiple inheritances? a. Dot b. Comma c. Dollar d. star
时间: 2024-03-18 22:40:31 浏览: 14
In C++, a comma (`,`) is used to create multiple inheritances. When a derived class is derived from multiple base classes, the class declaration includes the base class names separated by commas. For example:
```
class DerivedClass : public BaseClass1, public BaseClass2, private BaseClass3 {
// class members
};
```
In this example, `DerivedClass` is derived from three base classes - `BaseClass1`, `BaseClass2`, and `BaseClass3`. The access specifiers `public` and `private` specify the access level of the derived class to the base class members. Therefore, the correct answer is b. Comma.