[問題] bitset 宣告陣列的一個問題
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
VC++
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
bitset
問題(Question):
我想要宣告一個bitset的陣列,可是compile一直不過
餵入的資料(Input):
bitset<3> A[4] = {string("000"), string("001"), string("010"), string("100") }
預期的正確結果(Expected Output):
A[0] = 000, .....
錯誤結果(Wrong Output):
無法compile
程式碼(Code):(請善用置底文網頁, 記得排版)
補充說明(Supplement):
我把string的東西換成數字
bitset<3> A[4] = { 0, 1, 2, 4 }
這樣就可以過
但是我想用string來宣告,這樣比較方便
有沒有辦法呢?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.113.22.70
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 2 篇):
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章