如何連接i +名+字母+ i?如何在C++中連接字符串+ int +字符串?
for(int i = 0; i < 10; ++i){
//I need a const char* to pass as a parameter to another function
const char* name = "mki";
//The letter is equal to "A" for the first 2, "B" for the second 3,
//"C" for the following 4 ...
const char* final_string = ???
}
我已經嘗試使用:
std::to_string(i)
但我得到一個錯誤,指出
to_string未定義性病
我使用Visual C++。
使用'的std :: stringstream' – Ari0nhh
檢查[這個答案](http://stackoverflow.com/questions/5590381/easiest-way-to-convert-int-to-string-in-c/ 5590404#5590404)關於相關(不重複)的問題。 Sam的答案的宏觀版本。 – DevSolar