如何在字符串上使用GetByteCount?

时间:2015-06-16 14:16:45

标签: visual-c++

编译器抛出错误

*18 IntelliSense: no instance of overloaded function "System::Text::UTF8Encoding::GetByteCount" matches the argument list
        argument types are: (const std::string)
        object type is: System::Text::UTF8Encoding ^*   

到目前为止,我的代码是

std::vector<byte> sha1(const std::string& plaintext)
{
    System::Text::UTF8Encoding^ utf8 = gcnew System::Text::UTF8Encoding;
    int byteCount = utf8->GetByteCount(plaintext);
    ....
    ....
}

0 个答案:

没有答案