[問題] CLR模式將ascii轉字元(Done)
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
vc++2008
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
問題(Question):
ascii轉字元失敗
餵入的資料(Input):
116 101 115 116
預期的正確結果(Expected Output):
t e s t
錯誤結果(Wrong Output):
116 101 115 116
程式碼(Code):(請善用置底文網頁, 記得排版)
http://codepad.org/KPdstoJO
補充說明(Supplement):
使用vc++內建的windows form 實現rsa
加密的部份使用Convert::Toint32() 沒問題
但解密時 Convert::ToChar() 卻不能轉換
原c++ char ch = (char)key 在這裡也行不通
該怎麼做呢??
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.39.246.90
※ 文章網址: http://www.ptt.cc/bbs/C_and_CPP/M.1415549028.A.68F.html
→
11/10 01:14, , 1F
11/10 01:14, 1F
不是使用傳統 printf 、 cout 這種的
是視窗程式中有格子輸出的
程式碼已補上
※ 編輯: nonumber (114.39.244.60), 11/10/2014 08:54:31
→
11/10 11:01, , 2F
11/10 11:01, 2F
→
11/10 17:06, , 3F
11/10 17:06, 3F
→
11/10 17:06, , 4F
11/10 17:06, 4F
解完了 感謝彼特硬幣 Encoding::ASCII->GetString(Byte) 才對
創一個Byte array存要轉的int 用上面的函式直接轉字串輸出
※ 編輯: nonumber (114.39.244.60), 11/10/2014 19:58:32