簡體   English   中英

在C ++中用字符串連接const char *的最干凈方法是什么?

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM