gpt4 book ai didi

c++ - TBuf 到 TInt Symbian

转载 作者:塔克拉玛干 更新时间:2023-11-03 07:01:27 26 4
gpt4 key购买 nike

我只是想在 Symbian 中将 TBuf 转换为 TInt。我尝试通过以下方式进行:

TBuf<2> buf;
buf.Copy( _L("10"));

TInt valInt;
TLex8 lex(buf);
lex.Val(valInt);

然后我得到错误信息:

Error:  #289: no instance of constructor "TPtrC8::TPtrC8" matches the argument list
argument types are: (TBuf<2>)

非常感谢您的帮助!

谢谢

最佳答案

如果您正在使用TLex8,则必须使用TBuf8

试试这个(我的 Symbian C++ 生锈了,但这应该很接近):

TBuf8<2> buf;
buf.Copy(_L8("10"));

TInt valInt;
TLex8 lex(buf);
lex.Val(valInt);

关于c++ - TBuf 到 TInt Symbian,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1244453/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com