what does this function declaration mean in c++

前端 未结 11 1869
-上瘾入骨i
-上瘾入骨i 2020-12-24 13:12
virtual const char* what() const throw()
{

}

AFAIK it\'s a function that will return a constant pointer to a mutable char. The rest I am not sure.

11条回答
  •  悲&欢浪女
    2020-12-24 13:39

    the function what() takes no parameters, returns a pointer to a const char (so you can't modify the what the pointer points to, but you can modify the pointer itself). It's virtual, so its behaviour can be overridden in derived classes. It won't throw exceptions. It doesn't modify any members of the class that it belongs to.

提交回复
热议问题