Hi Im trying to encode a string to a hex string to later use as a URL to navigate a web page, but first I will need to convert my string variable to a string of hex saved in a variable.
Can some one please help me achieve this?
int main(void)
{
string email = "test@gmail.com";
string pass = "password";
string ip = "10.10.10.10";
string login ="username=" + email + "&password=" + pass + "&ip=" + ip;
string res;
int loc = 0;
while (login[loc] != NULL)
{
int temp = hex(login[loc]);
res += temp;
loc++;
}
string url = "
http://" + res+ ".com"
return 0;
}
now this code dose not work it is an example of what I am trying to achieve,
my apologizes for being new to C++, I only have experience with AutoIt and can achieve this code as follows :-
while $loc <= StringLen($loginid)
$RES = $RES & hex(Asc(StringMid($loginid,$loc,1)),2)
$loc += 1
WEnd
I would very much like to know how to do this in C++