Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

有關string

0 views
Skip to first unread message

著迷於BlueTraveler的solo

unread,
Aug 23, 2002, 2:22:44 AM8/23/02
to
※ 引述《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.*


0 new messages