Home  >  Q&A  >  body text

中文翻译:C++ error

error: expected '(' for function-style cast or type construction.

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

在下有点懵逼了……

高洛峰高洛峰2765 days ago823

reply all(3)I'll reply

  • 阿神

    阿神2017-04-17 13:30:51

    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

    reply
    0
  • 天蓬老师

    天蓬老师2017-04-17 13:30:51

    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.

    reply
    0
  • 迷茫

    迷茫2017-04-17 13:30:51

    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(实质上就是构造函数)

    }

    reply
    0
  • Cancelreply