int decNum = 123456;
char hexNum[16];
// decimal number to hexadecimal number
sprintf_s(hexNum, 16, "%X", decNum);
printf("%d -> %s \n", decNum, hexNum);
// hexadecimal number to decimal number
sprintf_s(hexNum, 16, "FF");
decNum = (int)strtol(hexNum, nullptr, 16);
printf(" %s -> %d \n", hexNum, decNum);
Subscribe to:
Post Comments (Atom)
-
Aftter adding this line, in 'head' of the blogger template editor in html mode, you can use MathJax expressions. For a new ...
-
Linear Intersection for a Stereo Pair There are two images. Object point vs. image point, in the first image: $$ \begin{pmatrix} X \\...
-
char path[_MAX_PATH]; const char* varName = "[system environment variable name]"; size_t len; getenv_s(&len, path, 80, varName...
No comments:
Post a Comment