define:string str VS string str() | Sololearn: Learn to code for FREE!
+ 3

define:string str VS string str()

When I define a string object, what is the difference between these two forms: *string str* and *string str()*? Intuitively, both of these forms should refer to the default constructor, but why the contents seem to be different? Below is my code https://code.sololearn.com/cRa8cyXXEh59/?ref=app

7th Jul 2017, 3:19 AM
Yongliang He
Yongliang He - avatar
2 Respostas
7th Jul 2017, 3:38 AM
Hatsy Rei
Hatsy Rei - avatar
+ 1
@Hatsy Rei Thank you for the help! It's interesting, being a function prototype*^_^*
8th Jul 2017, 1:50 AM
Yongliang He
Yongliang He - avatar