c++ - TBuf 到 TInt Symbian

标签 c++ symbian descriptor

我只是想在 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/

相关文章:

c++ - 访问短信收件箱

Javascript onchange 在文本区域中运行(Symbian 浏览器)

python3 : bind method to class instance with . __get__(),它有效,但为什么呢?

python - 类属性无故改变值

c++ - while 循环和 if/else 语句不能正常工作

c++ - 如何检查模板类型是否是变体类型的类型之一?

c++ - 如何在 Qt 中创建 MD5 哈希?

c++ - 交叉编译器二进制执行错误

c++ - 在 Symbian S60 上读取 SIM 联系人

python - 为什么在 __init__ 函数中声明描述符类会破坏描述符功能?