Explore BrainMass

C library: hex to octal representation conversion

Is their a built-in function in C that can be used to convert hexadecimal representation of a number to octal representation?

Solution Preview

There is no single built-in function for the purpose, however you can use combination of scanf and printf family of functions (printf/scanf/fprintf/fscanf/sprintf/sscanf) to achieve the goal.

use format specification "%x" during scanning the ...

Solution Summary

Solution gives a small C program that demonstrates how to read a number in hexadecimal representation and output it in octal representation?