Problems
Here are the problem-solving sections for this chapter.
23. Binary to string conversion
Write a function that, given a range of 8-bit integers (such as an array or vector), returns a string that contains a hexadecimal representation of the input data. The function should be able to produce both uppercase and lowercase content. Here are some input and output examples:
Input: { 0xBA, 0xAD, 0xF0, 0x0D }
, output: "BAADF00D"
or "baadf00d"
Input: { 1,2,3,4,5,6 }
, output: "010203040506"
24. String to binary conversion
Write a function that, given a string containing hexadecimal digits as the input argument, returns a vector of 8-bit integers that represent the numerical deserialization of the string content. The following are examples:
Input: "BAADF00D"
or "baadF00D"
, output: {0xBA, 0xAD, 0xF0, 0x0D}
Input "010203040506"
, output: {1, 2, 3, 4, 5, 6}
25. Capitalizing an article title
Write a function that transforms an input text into a capitalized version, where every word starts with an uppercase...