I am not getting any syntax errors, however i have a logical error. My function singleNumConvert() does not seem to be working properly as it does not return the converted digit in binary. It should be passed a single integer than based on what the integer is, return the binary equivalent. It seems to just return a random integer. Not sure what I am missing, it has been a while since I have written in cpp.
Thanks.
An integer literal starting with 0 are interpreted in the octal numeral system (base 8) which is different from the decimal numeral system (base 10) that we are used to. This means that 0101 is not the same number as 101.
The loop that prints the array elements is not correct. The first value it prints is always 0 (assuming it's within bounds) because it is the element after last value that you wrote in the previous loop. It also never prints the value of numberHolder[0].
If you pass the value 5 to singleNumConvert you want it to return the value 101 (one hundred and one)? At the moment it returns the value 65 because 101 in the octal numeral system is the same as the value 65 in the decimal numeral system. If you want to return 101 you need to write it without 0 in front because otherwise it will be interpreted as an octal number.