i have a string variable that contains a hex value. What i want is to convert this string to an integer so i can subtract this value with another hex value. Code below:
string im_cmd = new string(ch3) //ch3 is char array type (ch3[])
im_cmd = myArray[position, 0]; // get the hex value from myArray
int vh = Convert.ToInt32(im_cmd);
int diff = vh - pc;
im_cmd = Convert.ToString(Convert.ToInt32(diff.ToString(), 16), 2);
for instance, if im_cmd = 00400004, then the variable vh = 0x00061a84
what i want is vh = 0x00400004
so i can subtract vh with the pc value that contains only hex values.
any ideas?