c++中字符數組與字符串的轉換

1:字符數組換爲字符串ios 見代碼數組 #include <iostream> #include <string> using namespace std; int main(){ char a[10]="aaaabbbba"; string s(&a[0],&a[strlen(a)]); cout<<s<<endl; system("pause"); } 2:把字符串轉換爲字符數組
相關文章
相關標籤/搜索