0
I'm trying to make a cipher, and need to assign each letter its number value, how can I do this and make it printable?
This is what I have so far. include <iostream> using namespace std; int main() { char[1] = "abcdefghijklmnopqrstuvwxyz" ; return 0; }
2 Antworten
0
Well, "char[1]" needs to become "char my_char[]" or similar. Judging by your code, you're not quite ready for anything complex.
You need a solid grounding first.
0
Make a char var like char a = 'a';
Then use int aa = static_cast<int>(a) and you will get the int value. Next make a key like adding 3 via a note in the code and use math. aa += 3. Then recast it. Might not be the best way now that I think about it but I typed this and it will give you something to play with.
edit~ drawback is this will assume a consecutive order.