I might be asking a duplicate question but can't seem to find it.
How do I convert a hex say from 1e
in an unsigned char to 0x1e
in an int (not unsigned)?
and to concatenate them i would need to
hex3 = (hex1 << 8) | hex2;
and if i wanted to do it over and over again could i do this?
hex3 = (hex3 << 8) | hex2;
sorry these might be really questions but i cant seem to get my head round binary operations :(
edit: so.. can i do this?
int hex;
while (!feof(in))
{
unsigned char input = fgetc(in);
hex = hex + input;
};`
if the input
was 1e
will the hex
be 0x1e
and I later want to concatenate so if the next input
was ff
i would wan the output to be 0x1eff