2021年3月22日星期一

Display Hexadecimal Digits

How would I display hexadecimal digits or decimal, based on the user's input at the command line using. Prompt the user to input a character.

void output_hex(char ch)  {      std::cout << std::hex << int(ch);  }    int main(int argc, char **argv)  {      std::string str("hello");      std::for_each(str.begin(), str.end(), output_hex);      return 0;  }  

so far this is what I got.

https://stackoverflow.com/questions/66754309/display-hexadecimal-digits March 23, 2021 at 05:49AM

没有评论:

发表评论