将字符数组的内容转换为 ASCII 键值

我正在编写一个 Caesar Cipher 程序,我将用户输入作为字符串,然后将该字符串转换为字符数组,我一直坚持将该数组中的所有字符转换为 ASCII 键值,因为在每次程序运行时数组都可以更改,具体取决于用户输入的消息我如何检查数组中的字符数量,然后使用返回的数字将所有数字转换为 ASCII 键值

#include <iostream>
#include <string>
#include <cstring>
#include <algorithm>

using namespace std;

int main()
{
    string Message;
    char arr[Message.length() + 1];

    cout << "Please Enter The Text You Would Like To Encrypt(seperate words using _ and only write in lower case)" << endl;
    cin >> Message;

    strcpy(arr,Message.c_str());

    int Length = string(arr).length();
    
}
stu5229 回答:将字符数组的内容转换为 ASCII 键值

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/462.html

大家都在问