c++ - Reading in HEX number from file -


this has me pretty bothered should able when read in hex number , assign unsigned int when print out different number. advice great. thanks

#include <iostream> #include <fstream> #include <string> using namespace std;  int main() { fstream myfile; myfile.open("test.text"); unsigned int tester; string test; myfile >> hex >> tester; cout << tester; system("pause"); return 0; } 

i bet don't "different number".

i bet same value, in decimal representation.

you're extracting hex-representation value (myfile >> hex >> tester); insert one, (cout << hex << tester)!


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -