Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- int main(void) {
- ifstream file("file.txt");
- int num;
- file>>hex>>num; // Lê um valor hexa do arquivo
- cout<<num<<endl; // Exibe num na tela na base decimal mesmo
- cout<<hex<<num<<endl; // Exibe num na tela na base hexa
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement