Hi I'm fairly new to C++ and programming in general and I'm trying to get a program to check the parameters of a binary string before converting that string to dec values. I have the user input 'num' line 39 - 42, but I want to reuse that same value in the 'void bin_to_dec()' function. Is there anyway I can use the same variable between void functions?
You can make bin_to_dec() accept num as a parameter and pass it to it.
Alternatively, you could read the string in main() (i.e., move lines 40~42 into main) and pass the string num into each of those functions as a parameter. However, you may want to make check_bin_nums() actually report whether the string is valid (probably by returning a boolean) so you don't try to then use bin_to_dec() on an invalid string.
"void function" is incorrect terminology, by the way. You can say "void-returning function" or "function with no return value", but don't say "void function".