Strings of unsigned chars

后端 未结 3 1121
猫巷女王i
猫巷女王i 2021-01-16 04:46

Here\'s an interesting one. I\'m writing an AES encryption algorithm, and have managed to get it making accurate encryptions. The trouble comes when I attempt to write the r

3条回答
  •  没有蜡笔的小新
    2021-01-16 05:22

    std::string is nothing more or less than a specialization of the std::basic_string<> template, so you can simply do a

    typedef std::basic_string ustring;
    

    to get what you want.


    Note that the C/C++ standards do not define whether char is the signed or the unsigned variety, so any program that casts a char directly to a larger type invokes implementation defined behaviour.

提交回复
热议问题