I can do this:
int main(int argc, char** argv) {
unsigned char cTest = 0xff;
return 0;
}
But what's the right way to get a hexadecimal number into the program via the command line?
unsigned char cTest = argv[1];
doesn't do the trick. That produces a initialization makes integer from pointer without a cast warning.
I think some people arriving here might just be looking for:
$ ./prog `python -c 'print "\x41\x42\x43"'`
$ ./prog `perl -e 'print "\x41\x42\x43"'`
$ ./prog `ruby -e 'print "\x41\x42\x43"'`