C++ equivalent to C# Encoding.ASCII.GetBytes()
C++ equivalent to C# Encoding.ASCII.GetBytes()
我来自C#,我有一行:
byte[] key = Encoding.ASCII.GetBytes("myString");
我怎样才能在C++中获得等价物才能获得std::vector<unsigned char>
?
这应该可以解决问题吗?
unsigned char buffer[mystring.length()];
memcpy(buffer, mystring.data(), mystring.length());
相关文章:
- C++,在int数组中输入字符串或字符会输出0,而不是ascii或error
- 为什么我的C++程序的程序集输出充满了 .ascii,没有汇编代码?
- 有没有办法通过使用十进制 ASCII 代码自动类型扣除来获取字符?
- 如何将字节数组元素替换为修改的十六进制 ASCII 符号?
- ascii 和 unicode 在处理级别有什么区别吗?
- 在C++中使用 ASCII 代码将输入从小写转换为大写
- 弄清楚如何在C++中将整数读入 ASCII
- 如何修复艺术ASCII,我点击一个字母就可以了,但输入一个阶段艺术出来了
- 使用指针将 ASCII 值添加到整数
- 用于 ASCII 的环绕式 C++
- RE2 不匹配非 ASCII 字符
- 打印从 0 到 255 的所有 ASCII 字符
- C++ 电话号码字母拨号程序 - 语法错别字?还是非 ASCII 字符?
- 无符号字符打印其 ASCII 值
- Windows 非 ASCII 文件路径
- 非 ASCII 文件路径窗口
- 我的程序将 26 个字母转换为 ascII 没有显示正确答案
- 我写的 ASCII 到二进制转换器C++向后显示二进制,如何使其正确显示?
- 如何从 QString 中包含的十六进制值中获取 ASCII 字符?
- C++ equivalent to C# Encoding.ASCII.GetBytes()