Okay, as the name implies, I would like to change an integer (ascii code number), such as 65, to a string, '65', then back to integer, 65. Now, the reason for doing so, is because I'm working with ascii code, and want to return a string of a fixed length. As known, ascii ranges from 1 - 256. I only want to capture the values from 32 and up. Here are my issues:
1) Check the length of the integer; ( such as the python expression len(str(65)) == 2
)
2) If the length is 2, then make the string be '0' + number;
3) Combine all the strings into one;
4) Convert that back into a number
I have only recently begun c++ programming, after 3~4 months of python programming (Gotten really good at it), and c++ is really confusing.
In a more technical version of what I want to do, assume that my input is 65, 87, 121, 54
Then it'll return:
65087121054
Any help would be greatly appreciated. All I know to do is this:
#include <iostream>
#include <conio.h>
char current;
char pass[100];
int passcount(0);
/* For converting the getch() to ascii code and append to the char array:
pass[passcount] = char(current);
*/