※ 引述《
phone...@zoo.ee.ntu.edu.tw (夜叉劍少異端神)》之銘言:
> ※ 引述《
thp...@whshs.cs.nccu.edu.tw (沒有肉體的靈魂)》之銘言:
> : 請問一下..
> : 要怎麼把一個string資料傳進一個字元陣列裡...
> : #include<string>
> : using namespace std;
> : main()
> : {
> : string s1;
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^
> C++有stringㄇ
C++當然有 string !
> : const int max = 1024;
> : char str[max];
> : →str = s1; ?????
> : }
> : 這樣子好像不行耶...
strcpy ( str, s1.c_str());
--
----== Posted via Openfind 網路論壇 ==-----
http://bbs.openfind.com.tw/ 提供免費的登載文章及查詢服務
※來源:203.73.*