史萊姆論壇

史萊姆論壇 (http://forum.slime.com.tw/)
-   一般電腦疑難討論區 (http://forum.slime.com.tw/f17.html)
-   -   請問會寫C++ㄉ大大... (http://forum.slime.com.tw/thread144029.html)

juju73729 2005-03-07 12:34 AM

請問會寫C++ㄉ大大...
 
1.請問一下如何把字元轉成字串陣列(string array)

2.字串類別(string calss)是否也有一些和字串陣列(string array)相同功能ㄉ函數
如在字串陣列(string array)中
isupper 表示檢查字串是否為大寫
islower 表是檢查字串是否為小寫

然...這些函數在字串類別(string calss)中都無法使用

snoopy 2005-03-07 05:10 PM

引用:

作者: juju73729
1.請問一下如何把字元轉成字串陣列(string array)

2.字串類別(string calss)是否也有一些和字串陣列(string array)相同功能ㄉ函數
如在字串陣列(string array)中
isupper 表示檢查字串是否為大寫
islower 表是檢查字串是否為小寫

然...這些函數在字串類別(string calss)中都無法使用

1.請問一下如何把字元轉成字串陣列(string array)

應該是把字元陣列轉成字串吧
字元陣列本身就是字串 一體兩面ㄉ東西 所以不用互轉
因為C語言的字串就是字元陣列做的

2.string是處理字串的函式庫
檢查你的參數型態是否正確

mini 2005-03-07 08:19 PM

原來 是為了解決2 而問1

char b[]={'T','E','S','T'};
LPSTR a;

LPCTSTR : A 32-bit pointer to a constant character string that is portable for Unicode and DBCS.
LPTSTR : A 32-bit pointer to a character string that is portable for Unicode and DBCS.
LPCSTR : A 32-bit pointer to a constant character string.
LPSTR : A 32-bit pointer to a character string.

b 是 字串陣列
a 是 字串類別,應該說是字元指標

所以你可以直接引用這些類別(當然要引入適當標頭檔)


所有時間均為台北時間。現在的時間是 12:55 AM

Powered by vBulletin® 版本 3.6.8
版權所有 ©2000 - 2025, Jelsoft Enterprises Ltd.

『服務條款』

* 有問題不知道該怎麼解決嗎?請聯絡本站的系統管理員 *


SEO by vBSEO 3.6.1