Hi, I need to read every two characters from a string inputted by the user, then convert that from hex to decimal form. I don't know how to start this so can someone please help? 2. >>I don't know how to start

Hint:
Code:
```#include <string>
#include <iostream>

int main()
{
}``` 3. Sorry, maybe i was to vague.

Code:
```#include <iostream>
#include <string.h>
using namespace std;
int main()
{
int   intpass;
string enpass, hexpass;

cin >> hexpass;

intpass = (int(hexpass.at(0)) + (hexpass.at(1)));
cout << hex << intpass;

cin.ignore();
cin.get();
return 0;
}```
The String will look something like this

A347F2B74EE9A9F6

I want to read every two characters, ( they're already in hex form) then convert to int. 4. You need to use a loop to traverse through the string and extracting 2 characters until it reaches the end of the string. 5. I was going to use a loop, but the thing is A3 in decimal 163. What I'm doing now is taking the value of A and adding it to the value of 3, which is not 163. I don't know how to store 2 characters like this. 6. What I'm doing now is taking the value of A and adding it to the value of 3, which is not 163.
You need to multiply by 16 before adding. Of course the value of 0xA is 10, not 65. 7. I would probably try and create another function that converts hex to decimal that takes 2 characters and returns back the decimal value. You could use a mini-symbol table to link up 'A' to 10, 'B' to 11 etc. and then just do "firstdigit * 16 + seconddigit" and return that. Popular pages Recent additions 