{"categories":["C++"],"blog_url":"https://secret-garden.hatenablog.com/","type":"rich","url":"https://secret-garden.hatenablog.com/entry/2016/04/14/004729","provider_name":"Hatena Blog","title":"std::string \u306e\u9014\u4e2d\u306b null \u6587\u5b57\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u5834\u5408\u306e\u51e6\u7406","author_name":"osyo-manga","author_url":"https://blog.hatena.ne.jp/osyo-manga/","blog_title":"Secret Garden(Instrumental)","provider_url":"https://hatena.blog","version":"1.0","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fsecret-garden.hatenablog.com%2Fentry%2F2016%2F04%2F14%2F004729\" title=\"std::string \u306e\u9014\u4e2d\u306b null \u6587\u5b57\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u5834\u5408\u306e\u51e6\u7406 - Secret Garden(Instrumental)\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","published":"2016-04-14 00:47:29","description":"Twitter \u3067\u898b\u304b\u3051\u305f\u3093\u3067\u3059\u304c\u3001\u6b21\u306e\u3088\u3046\u306b\u9014\u4e2d\u306b null \u6587\u5b57\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u5834\u5408\u3067\u3082\u6700\u5f8c\u307e\u3067\u51fa\u529b\u3055\u308c\u307e\u3059\u3002 #include <string> #include <vector> #include <iostream> int main(){ std::vector<char> chars { 'h', 'o', '\\0', 'm', 'e' }; std::string str(chars.begin(), chars.end()); std::cout << str.c_str() << std::endl; std::cout << str.length() << std::end\u2026","height":"190","width":"100%","image_url":null}