看板 C_Sharp 關於我們 聯絡資訊
※ 引述《zxvc (zxvc)》之銘言: : 二進位數字字串轉整數的方法, : 這可以部分替代Standard C++ Library的bitset class功能。 : For C++/CLI ( 我不會C# XD ): : String ^ BinStr = "101"; : // Number 5 in decimal. : MessageBox::Show( Convert::ToUInt32( BinStr, 2 ) + "" ); : // The second argument of ToUin32 represents base 2. 今天又在Google搜到如何把十進位數轉成特定bit數的方法 ( For C++/CLI ): MessageBox::Show( Convert::ToString( DecNum, 2 )->PadLeft( 8, '0' ) ); // PadLeft pads character '0' to the left of a string, // so that the bits of a binary number is 8. -- 往生淨土咒: 南無阿彌多婆夜 哆他伽哆夜 哆地夜他 阿彌唎都婆毘 阿彌唎哆  悉耽婆毘 阿彌唎哆 毘迦蘭哆 伽彌膩 伽伽那 只多迦隸 莎婆訶 《佛說阿彌陀經》http://web.cc.ncu.edu.tw/~93501025/amtf.doc 《金剛經》http://web.cc.ncu.edu.tw/~93501025/jg.doc -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.115.204.3 ※ 編輯: zxvc 來自: 140.115.204.3 (09/08 08:33)