Symbian C++ 中的 unsigned char* 到 const TDesC8
我想通过 Socket 发送一个 unsigned char * ,而 RSockt.Send 具有以下签名:
IMPORT_C void Send(const TDesC8 &aDesc, TUint someFlags, TRequestStatus &aStatus);
我尝试按以下方式执行此操作,但这给了我一条错误消息:
Socket.Send( TPtrC8 ptr((TUint8*)charvariable), 0, iStatus);
Error #254: Type name is not allowed.
还有其他建议吗?
谢谢
I wanna send an unsigned char * over the Socket whereas the RSockt.Send has the following signature:
IMPORT_C void Send(const TDesC8 &aDesc, TUint someFlags, TRequestStatus &aStatus);
I tried to do it the following way but that gives me an error message:
Socket.Send( TPtrC8 ptr((TUint8*)charvariable), 0, iStatus);
Error #254: Type name is not allowed.
Any other suggestions?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您很接近,但无法在表达式中声明变量。 具体方法如下:
请注意,这假设
unsigned char *
数据以零结尾。You were close but you cannot declare a variable within an expression. Here's how:
Note that this assumes the
unsigned char *
data is zero terminated.