I am suppose to produce a code using functions that converts binary numbers to decimal or octal.
There's no such thing like converting binary numbers to decimal or octal based on numerical representations as
long int toDeci(long int);
long int toOct(long int);
Such functions are completely nonsensical for any semantical interpretation.
Numbers are numbers, and their textual representation can be in decimal, hex, octal or binary format:
dec 42
hex 0x2A
oct 052
bin 101010
are all still the same number in a long int
data type.
Using the c++ standard I/O manipulators enable you to make conversions of these formats from their textual representations.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…