![](/img/trans.png)
[英]What is the simplest way to convert a const char[] to a string in c++
[英]what is the cleanest way to concat a const char * with a string in c++?
我知道我可以使用stringstream
但是我希望有一種更簡單的方式來編寫"hello" + a_std_string_object
。
如果您使用的是舊的/損壞的編譯器,則可能需要
string("hello") + std_string_object
但是在現代編譯器中,自然代碼
"hello" + std_string_object
應該管用。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.