C++ empty String constructor

后端 未结 7 1914
误落风尘
误落风尘 2021-02-13 02:56

I am a C++ beginner, so sorry if the question is too basic.

I have tried to collect the string constrcturs and try all them out (to remember them).

strin         


        
7条回答
  •  悲哀的现实
    2021-02-13 02:58

    Compiler interprets string strA() as a function prototype of a function which takes void arguments and returns an object of string type. If you want to create a empty string object use string strA; (without paranthesis)

提交回复
热议问题