Question 31: A C++ developer wants to handle a static_cast() operation for the class String shown below. Which of the following

来源:互联网 发布:黑暗之魂剧情知乎 编辑:程序博客网 时间:2024/05/21 10:48

class String {

public:

   //...

   //declaration goes here

};

 

    A. char* operator();

    B. char* operator char*();

    C. String operator char*();

    D. operator char*();

    E. char* operator String();

D

2种会导致隐式类型转换的方法  1 单参数构造函数 2operator+类型名