[問題] bitset 宣告陣列的一個問題

看板C_and_CPP (C/C++)作者 (eton)時間14年前 (2012/05/26 10:17), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/2 (看更多)
開發平台(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
文章代碼(AID): #1Fm3rJGH (C_and_CPP)
文章代碼(AID): #1Fm3rJGH (C_and_CPP)