so i'm attempting to change the value of chars (a-z, and 0-9) to 0-35. (a is 0, z is 25, 0 is 26, 9 is 35) can someone give me some help on how to do this? would pointers work for this?
Also, i'm attempting to convert an integer into binary, and have those value put into an array (number by number), so that the array would be:
arrayname [0][0] == 32, arrayname [0][1] == 16, etc.
I have seen while loops to convert an integer to binary, but that only works to print it to the screen with cout, i couldn't make it work reading into an array.
so i'm attempting to change the value of chars (a-z, and 0-9) to 0-35. (a is 0, z is 25, 0 is 26, 9 is 35) can someone give me some help on how to do this? would pointers work for this?
It's not possible unless you modify the compiler and character set you're using, which are both way out of even my abilities. Make sure you realize that the number associated with characters is not the same everywhere in the world, so NEVER rely on the numbers referring to specific characters.
What have you attempted with the binary thing? Hint: start with the program that prints it to the screen.
I've already gotten it to where you can turn it into binary and print the binary on the screen using cout. however i can't get the loop to be able to store the 0's and 1's in a string, array, etc.
I'm just puzzled as how to get the loop to store the output in a string or array.
edit: i know the loop functions recursively, but i just can't think of how to implement a counter of some sort to determine the position of the digit. Unless i have the function pass another int (which starts at o for the original function call) that increases each time the function calls itself (pass int+1)?
I am having trouble understanding how there is a disconnect between "send character to console" and "append character to string". What exactly is confusing to you? I can't help unless I know that.
My problem is that the function is returning integer values and trying to add an integer to a string is giving me smiley faces when printing that string.
Turn on all warnings (-Wall -Wextra on clang++ and g++),
turn off all linuxisms (or microsoftisms) that are not C++ (-pedantic-errors on clang++ and g++),
and pay attention to the diagnostic messages emitted by the compiler.