2012-03-10 137 views

回答

6

可以使用的std ::六角機械臂:

#include <fstream> 
#include <iostream> 

using std::cout; 
using std::hex; 
using std::ifstream; 

int main() { 
    ifstream input("file"); 
    int data; 
    while(input >> hex >> data) { 
     cout << data << std::endl; 
    } 
} 
+0

謝謝你,我會嘗試一下.. – cutesue 2012-03-10 20:49:57

+3

要確保,如果你找到解決的有效選擇此爲最佳答案。 – 2012-03-10 20:51:12

+1

適用於全方位良好C++實踐(正確使用指令,安全I/O循環等)+1! – 2012-03-10 20:57:55

相關問題