Noob here. I have to write a program that converts a hexadecimal number to binary. Only using <iostream> and <string>. My approach was gonna be to do a char array, then extract each digit in a for loop to assign the 16 possible binary representations. Is there an easier way only using these two libraries? Can't use special features like stoi, stol, etc.
How do I get user input for a char array? So let's say the input is 0xffa. I need to skip the first two characters, then convert f into 1111, f into 1111, and a into 1010. Also I need to trim any leading zero's from the front.
Sorry if this is a broad question, but I can't seem to find articles where people only use the simplest libraries. Thank you.