-2

I am new to C++ 11 & 14. In my new role I saw a code where string was initialized (below) and I do not know what is this new way called and where to read about it. Can some one tell what is it called and how does it work. Regards.

std::string mystring{""};
Ahmed
  • 489
  • 4
  • 12
  • I think this question shall not be removed. My reasoning is that if someone searches SO with keyword std::string {""} then they should get some results. In my case when I searched SO I got nothing. This question is going to be helpful for newbies. – Ahmed Jul 04 '19 at 02:40

1 Answers1

2

This is initialization with string literal, refer to :https://en.cppreference.com/w/cpp/string/basic_string/basic_string see Notes.

Your example is same as std:string s{"",0};

v01d
  • 189
  • 1
  • 12