中文翻译:C++ error
高洛峰
高洛峰 2017-04-17 13:28:51
0
3
846
error: expected '(' for function-style cast or type construction.

请教下各位,这个error要如何翻译成中文比较好?

在下有点懵逼了……

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all(3)
阿神

Error: Expecting a '(' for function-style type conversion and type construction
I remember that there seems to be an error caused by calling a function that does not accept parameters and then forgetting to type (). Of course Maybe I remembered it wrong, or there are other reasons

Peter_Zhu

This may mean that C-style forced data conversion was used during the data conversion process and was used incorrectly. The compiler recommends using C++-style type conversion.

迷茫

Functional style conversion or constructor requires "("

This is a syntax error reported by the compiler. The compiler should think that your code is performing type conversion or writing a constructor but you did not add parentheses.

Functional style conversion:
class A {}
auto i = A(0); // Because it looks like a function call, it is called functional style conversion; unique to C++

Type construction:
class foo
{

foo() { /*...*/ } // type construction(实质上就是构造函数)

}

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template