//hex to decimal and bianary
char hex;
const string myHexString = hex;
char *line = "short line for testing";
long strtol( constchar *nptr, char **endptr, int base );
cout<<strtol(myHexString,NULL,16);
//int x = (int)c2;
cout << "int HEX: " << dec << x << endl;
system ("pause");
return 0;
this is my fricken code ... ive been working on this program for 2 weeks and this is the only problemn other then this the whole program works
thanks ill try both sugestons ill let you know if it works im in a seminar at the moment and i might get a couple minuites to throw it on my flash drive when i get back so i can take it home and try it. i will let you know thanks for the advice cuz after 3 weeks now im tired of debugging this and its the only problem
line 7 is what seems to be the problemn it says that there are problemns with strtlol is there maybe a library that i need to include ... this is just a snippit of code the rest of my code is unrelated tho
Are you not over complicating it or am i missing the point?
1) enter a number in hex format
cin>>n;//n is entered as b00b
2)cout<<dec<<n<<endl;//prints 45067
....so why enter the hex numeral as a string is what i'm asking?